aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/spend.h
diff options
context:
space:
mode:
authorS3RK <1466284+S3RK@users.noreply.github.com>2022-06-27 09:11:09 +0200
committerS3RK <1466284+S3RK@users.noreply.github.com>2022-06-28 08:54:39 +0200
commitd54c5c8b1b1a38b5b38e6878aea0fa8d6c1ad7e9 (patch)
tree0ba2083ed146887820accdd715d9f1b31c8adf4b /src/wallet/spend.h
parenta94659c84ee10ac5915eb5a6b654435183d88521 (diff)
downloadbitcoin-d54c5c8b1b1a38b5b38e6878aea0fa8d6c1ad7e9.tar.xz
wallet: use CCoinControl to estimate signature size
Diffstat (limited to 'src/wallet/spend.h')
-rw-r--r--src/wallet/spend.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/wallet/spend.h b/src/wallet/spend.h
index a7d91eb9c4..21f0095e77 100644
--- a/src/wallet/spend.h
+++ b/src/wallet/spend.h
@@ -14,20 +14,16 @@
namespace wallet {
/** Get the marginal bytes if spending the specified output from this transaction.
- * use_max_sig indicates whether to use the maximum sized, 72 byte signature when calculating the
- * size of the input spend. This should only be set when watch-only outputs are allowed */
-int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet, bool use_max_sig = false);
-int CalculateMaximumSignedInputSize(const CTxOut& txout, const SigningProvider* pwallet, bool use_max_sig = false);
-
+ * Use CoinControl to determine whether to expect signature grinding when calculating the size of the input spend. */
+int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet, const CCoinControl* coin_control = nullptr);
+int CalculateMaximumSignedInputSize(const CTxOut& txout, const COutPoint outpoint, const SigningProvider* pwallet, const CCoinControl* coin_control = nullptr);
struct TxSize {
int64_t vsize{-1};
int64_t weight{-1};
};
-/** Calculate the size of the transaction assuming all signatures are max size
-* Use DummySignatureCreator, which inserts 71 byte signatures everywhere.
-* NOTE: this requires that all inputs must be in mapWallet (eg the tx should
-* be AllInputsMine). */
+/** Calculate the size of the transaction using CoinControl to determine
+ * whether to expect signature grinding when calculating the size of the input spend. */
TxSize CalculateMaximumSignedTxSize(const CTransaction& tx, const CWallet* wallet, const std::vector<CTxOut>& txouts, const CCoinControl* coin_control = nullptr);
TxSize CalculateMaximumSignedTxSize(const CTransaction& tx, const CWallet* wallet, const CCoinControl* coin_control = nullptr) EXCLUSIVE_LOCKS_REQUIRED(wallet->cs_wallet);