aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-02-01 08:41:21 +0100
committerWladimir J. van der Laan <[email protected]>2017-02-01 08:42:53 +0100
commit7bfb77045c4b06db3597c023de97411ed287e252 (patch)
treeb9fb2476ca21c7d62366eab57aef7cdf5ec791a9 /src/wallet/wallet.cpp
parentMerge #9647: Skip RAII event tests if libevent is built without event_set_mem... (diff)
parentrpc: bumpfee: handle errors more gracefully (diff)
downloaddiscoin-7bfb77045c4b06db3597c023de97411ed287e252.tar.xz
discoin-7bfb77045c4b06db3597c023de97411ed287e252.zip
Merge #9640: Bumpfee: bugfixes for error handling and feerate calculation
9522b53 rpc: bumpfee: handle errors more gracefully (Suhas Daftuar) f626594 rpc: bumpfee: use correct maximum signed tx size for fee calculation (Suhas Daftuar) d625b90 wallet: Refactor dummy signature signing for reusability (Suhas Daftuar)
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 9a5f35b6e..a7b8022bd 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);