You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#30309: wallet: notify when preset + automatic inputs exceed max weight
72b2268 wallet: notify when preset + automatic inputs exceed max weight (furszy)
Pull request description:
Small change. Found it while finishing my review on #29523. This does not interfere with it.
Basically, we are erroring out early when the automatic coin selection process exceeds the maximum weight, but we are not doing so when the user-preselected inputs combined with the wallet-selected inputs exceed the maximum weight.
This change avoids signing all inputs before erroring out and introduces test coverage for `fundrawtransaction`.
ACKs for top commit:
achow101:
ACK 72b2268
tdb3:
re ACK for 72b2268
rkrux:
tACK [72b2268](bitcoin/bitcoin@72b2268)
ismaelsadeeq:
utACK 72b2268
Tree-SHA512: d77be19231023383a9c79a5d66b642dcbc6ebfc31a363e0b9f063c44898720a7859ec211cdbc0914ac7a3bfdf15e52fb8fc20d97f171431f70492c0f159dbc36
# 1) Try to fund transaction only using the preset inputs
1332
+
input_weights= []
1333
+
foriinrange(1471):
1334
+
input_weights.append({"txid": txid, "vout": i, "weight": 273})
1335
+
assert_raises_rpc_error(-4, "Transaction too large", wallet.fundrawtransaction, hexstring=rawtx, input_weights=input_weights)
1336
+
1337
+
# 2) Let the wallet fund the transaction
1338
+
assert_raises_rpc_error(-4, "The inputs size exceeds the maximum weight. Please try sending a smaller amount or manually consolidating your wallet's UTXOs",
1339
+
wallet.fundrawtransaction, hexstring=rawtx)
1340
+
1341
+
# 3) Pre-select some inputs and let the wallet fill-up the remaining amount
1342
+
inputs=input_weights[0:1000]
1343
+
assert_raises_rpc_error(-4, "The combination of the pre-selected inputs and the wallet automatic inputs selection exceeds the transaction maximum weight. Please try sending a smaller amount or manually consolidating your wallet's UTXOs",
assert_raises_rpc_error(-4, "The inputs size exceeds the maximum weight. Please try sending a smaller amount or manually consolidating your wallet's UTXOs",
# 3) Pre-select some inputs and let the wallet fill-up the remaining amount
607
+
inputs=inputs[0:1000]
608
+
assert_raises_rpc_error(-4, "The combination of the pre-selected inputs and the wallet automatic inputs selection exceeds the transaction maximum weight. Please try sending a smaller amount or manually consolidating your wallet's UTXOs",
0 commit comments