Пример #1
0
 void TransactionImpl::setExtraNonce(const BinaryArray& nonce) {
   checkIfSigning();
   TransactionExtraNonce extraNonce = { nonce };
   extra.set(extraNonce);
   transaction.extra = extra.serialize();
   invalidateHash();
 }
Пример #2
0
 bool TransactionImpl::getExtraNonce(BinaryArray& nonce) const {
   TransactionExtraNonce extraNonce;
   if (extra.get(extraNonce)) {
     nonce = extraNonce.nonce;
     return true;
   }
   return false;
 }
Пример #3
0
  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;
  }
Пример #4
0
 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;
}