diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -72,7 +72,7 @@ } static int verify_script(const uint8_t *scriptPubKey, - unsigned int scriptPubKeyLen, CAmount amount, + unsigned int scriptPubKeyLen, Amount amount, const uint8_t *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err) { @@ -105,7 +105,7 @@ const uint8_t *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const uint8_t *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err) { - CAmount am(amount); + Amount am(amount); return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err); } @@ -120,7 +120,7 @@ return set_error(err, bitcoinconsensus_ERR_AMOUNT_REQUIRED); } - CAmount am(0); + Amount am(0); return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err); } diff --git a/src/script/interpreter.h b/src/script/interpreter.h --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -121,8 +121,7 @@ ScriptError *serror); uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, - unsigned int nIn, uint32_t nHashType, - const Amount &amount, + unsigned int nIn, uint32_t nHashType, const Amount amount, const PrecomputedTransactionData *cache = nullptr, uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID); @@ -159,10 +158,10 @@ public: TransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, - const Amount &amountIn) + const Amount amountIn) : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(nullptr) {} TransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, - const Amount &amountIn, + const Amount amountIn, const PrecomputedTransactionData &txdataIn) : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(&txdataIn) {} bool CheckSig(const std::vector &scriptSig, @@ -178,7 +177,7 @@ public: MutableTransactionSignatureChecker(const CMutableTransaction *txToIn, - unsigned int nInIn, const Amount &amount) + unsigned int nInIn, const Amount amount) : TransactionSignatureChecker(&txTo, nInIn, amount), txTo(*txToIn) {} }; diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1349,8 +1349,7 @@ } uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, - unsigned int nIn, uint32_t nHashType, - const Amount &amount, + unsigned int nIn, uint32_t nHashType, const Amount amount, const PrecomputedTransactionData *cache, uint32_t flags) { if ((nHashType & SIGHASH_FORKID) && (flags & SCRIPT_ENABLE_SIGHASH_FORKID)) { diff --git a/src/script/sigcache.h b/src/script/sigcache.h --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -45,8 +45,8 @@ public: CachingTransactionSignatureChecker(const CTransaction *txToIn, - unsigned int nInIn, - const CAmount &amount, bool storeIn, + unsigned int nInIn, const Amount amount, + bool storeIn, PrecomputedTransactionData &txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amount, txdataIn), store(storeIn) {} diff --git a/src/script/sign.h b/src/script/sign.h --- a/src/script/sign.h +++ b/src/script/sign.h @@ -35,14 +35,14 @@ class TransactionSignatureCreator : public BaseSignatureCreator { const CTransaction *txTo; unsigned int nIn; - CAmount amount; + Amount amount; uint32_t nHashType; const TransactionSignatureChecker checker; public: TransactionSignatureCreator(const CKeyStore *keystoreIn, const CTransaction *txToIn, unsigned int nInIn, - const CAmount amountIn, + const Amount amountIn, uint32_t nHashTypeIn = SIGHASH_ALL); const BaseSignatureChecker &Checker() const { return checker; } bool CreateSig(std::vector &vchSig, const CKeyID &keyid, @@ -55,7 +55,7 @@ public: MutableTransactionSignatureCreator(const CKeyStore *keystoreIn, const CMutableTransaction *txToIn, - unsigned int nInIn, const CAmount amount, + unsigned int nInIn, const Amount amount, uint32_t nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amount, nHashTypeIn), @@ -86,7 +86,7 @@ /** Produce a script signature for a transaction. */ bool SignSignature(const CKeyStore &keystore, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, - const CAmount amount, uint32_t nHashType); + const Amount amount, uint32_t nHashType); bool SignSignature(const CKeyStore &keystore, const CTransaction &txFrom, CMutableTransaction &txTo, unsigned int nIn, uint32_t nHashType); diff --git a/src/script/sign.cpp b/src/script/sign.cpp --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -16,7 +16,7 @@ TransactionSignatureCreator::TransactionSignatureCreator( const CKeyStore *keystoreIn, const CTransaction *txToIn, unsigned int nInIn, - const CAmount amountIn, uint32_t nHashTypeIn) + const Amount amountIn, uint32_t nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), amount(amountIn), nHashType(nHashTypeIn), checker(txTo, nIn, amountIn) {} @@ -182,7 +182,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, - const CAmount amount, uint32_t nHashType) { + const Amount amount, uint32_t nHashType) { assert(nIn < txTo.vin.size()); CTransaction txToConst(txTo);