void TransactionImpl::setExtraNonce(const BinaryArray& nonce) { checkIfSigning(); TransactionExtraNonce extraNonce = { nonce }; extra.set(extraNonce); transaction.extra = extra.serialize(); invalidateHash(); }
bool TransactionImpl::getExtraNonce(BinaryArray& nonce) const { TransactionExtraNonce extraNonce; if (extra.get(extraNonce)) { nonce = extraNonce.nonce; return true; } return false; }
void TransactionImpl::setTransactionSecretKey(const SecretKey& key) { const auto& sk = reinterpret_cast<const SecretKey&>(key); PublicKey pk; PublicKey txPubKey; secret_key_to_public_key(sk, pk); extra.getPublicKey(txPubKey); if (txPubKey != pk) { throw std::runtime_error("Secret transaction key does not match public key"); } secretKey = key; }
PublicKey TransactionImpl::getTransactionPublicKey() const { PublicKey pk(NULL_PUBLIC_KEY); extra.getPublicKey(pk); return pk; }
PublicKey TransactionPrefixImpl::getTransactionPublicKey() const { Crypto::PublicKey pk(NULL_PUBLIC_KEY); m_extra.getPublicKey(pk); return pk; }