aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2019-11-23 09:33:31 +1300
committerSamuel Dobson <dobsonsa68@gmail.com>2019-11-23 09:33:41 +1300
commit2a97d2b1a525dbc8f6e6610fe543e003acfb7fac (patch)
tree030fcf444dbec77879ba86c940ff5637c93dbe39 /src
parent7127c310204787f1b981ef40a530fb22ccc7fc11 (diff)
parent6a2e6b0600077e5903400dc74bc8b0c26592fde6 (diff)
Merge #17553: wallet: Remove out of date comments for CalculateMaximumSignedTxSize
6a2e6b0600077e5903400dc74bc8b0c26592fde6 Remove out of date comments for CalculateMaximumSignedTxSize (Gregory Sanders) Pull request description: These paths can be hit for probably a number of reasons, and ISMINE spendability is not a requirement to call it. For example: During watch-only transaction creation, previous transaction in wallet, pubkey imported, but not the witnessscript associated with the prevout. In this case I think no/minimal comment is better than specific and soon to be out of date. ACKs for top commit: achow101: ACK 6a2e6b0600077e5903400dc74bc8b0c26592fde6 darosior: ACK 6a2e6b0600077e5903400dc74bc8b0c26592fde6 Tree-SHA512: ad4c26fd2409eb5aed19d67c19cb5479d226bd11e9298630309c4344f6562ace2e10c2850ebe22770331d71e91320a606e79619b9fe52dd478ce1f589a740122
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index fcb7bfecb8..b1e1385ca3 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1448,11 +1448,9 @@ bool CWallet::ImportScriptPubKeys(const std::string& label, const std::set<CScri
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet, bool use_max_sig)
{
std::vector<CTxOut> txouts;
- // Look up the inputs. We should have already checked that this transaction
- // IsAllFromMe(ISMINE_SPENDABLE), so every input should already be in our
- // wallet, with a valid index into the vout array, and the ability to sign.
for (const CTxIn& input : tx.vin) {
const auto mi = wallet->mapWallet.find(input.prevout.hash);
+ // Can not estimate size without knowing the input details
if (mi == wallet->mapWallet.end()) {
return -1;
}
@@ -1467,8 +1465,6 @@ int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wall
{
CMutableTransaction txNew(tx);
if (!wallet->DummySignTx(txNew, txouts, use_max_sig)) {
- // This should never happen, because IsAllFromMe(ISMINE_SPENDABLE)
- // implies that we can sign for every input.
return -1;
}
return GetVirtualTransactionSize(CTransaction(txNew));