diff options
author | Suhas Daftuar <sdaftuar@chaincode.com> | 2017-01-26 12:57:04 -0500 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2017-01-30 11:47:10 -0500 |
commit | d625b907a1800a5a30c4ad285641c7418d2c28c1 (patch) | |
tree | ab77fc0f12bd438e34a52882fbc97e667948a0cd /src/wallet/wallet.cpp | |
parent | e99f0d7ad443ff72087c6f80e9fab65cace0bf19 (diff) | |
download | bitcoin-d625b907a1800a5a30c4ad285641c7418d2c28c1.tar.xz |
wallet: Refactor dummy signature signing for reusability
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9a5f35b6e3..a7b8022bd9 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2583,21 +2583,9 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt std::numeric_limits<unsigned int>::max() - (fWalletRbf ? 2 : 1))); // Fill in dummy signatures for fee calculation. - int nIn = 0; - for (const auto& coin : setCoins) - { - const CScript& scriptPubKey = coin.first->tx->vout[coin.second].scriptPubKey; - SignatureData sigdata; - - if (!ProduceSignature(DummySignatureCreator(this), scriptPubKey, sigdata)) - { - strFailReason = _("Signing transaction failed"); - return false; - } else { - UpdateTransaction(txNew, nIn, sigdata); - } - - nIn++; + if (!DummySignTx(txNew, setCoins)) { + strFailReason = _("Signing transaction failed"); + return false; } unsigned int nBytes = GetVirtualTransactionSize(txNew); |