Previously, combinerawtransaction would silently return the first tx when asked to combine unrelated txs. Now, it will check tx mergeability and throws a descriptive error if tx cannot be merged.
fixes #25980
Previously, combinerawtransaction would silently return the first tx when asked to combine unrelated txs. Now, it will check tx mergeability and throws a descriptive error if tx cannot be merged.
fixes #25980
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31298.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | 1440000bytes, i-am-yuvi |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
No conflicts as of last run.
🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/33065613881
Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
combinepsbt
?
Can this use the same approach and error message as
combinepsbt
?
This is the same functional approach and error message already. Creating a PSBT involves stripping the scriptSig and scriptWitnesses. Later, the hashes are compared. That’s exactly what this change is doing too but the syntax is different. I can align the syntax to make it more clear it is doing the same thing.
Previously, combinerawtransaction would silently return the first tx when
asked to combine unrelated txs. Now, it will check tx mergeability and
throws a descriptive error if tx cannot be merged.
Later, the hashes are compared. That’s exactly what this change is doing too but the syntax is different.
0bool PartiallySignedTransaction::Merge(const PartiallySignedTransaction& psbt)
1{
2 // Prohibited to merge two PSBTs over different transactions
3 if (tx->GetHash() != psbt.tx->GetHash()) {
4 return false;
5 }
Right. Only the error message was different which looks same now,
Tested ACK 85c216871a01aab003e1b1aba6246b4178afc929
Below is my full test setup:
0error code: -8
1error message:
2Transaction 1 not compatible (different transactions)
Gives combine hex when same txns are provided
0./build/src/bitcoin-cli combinerawtransaction '["0200000001a0d2e799d40d404da2daf128fc678fdd15f245bdd92c6e1ad15b45f7258a47b90000000000fdffffff01008c86470000000016001483f259c98962117d75154f35cb55cd60b88a257e00000000","0200000001a0d2e799d40d404da2daf128fc678fdd15f245bdd92c6e1ad15b45f7258a47b90000000000fdffffff01008c86470000000016001483f259c98962117d75154f35cb55cd60b88a257e00000000"]'
10200000001a0d2e799d40d404da2daf128fc678fdd15f245bdd92c6e1ad15b45f7258a47b90000000000fdffffff01008c86470000000016001483f259c98962117d75154f35cb55cd60b88a257e00000000
for inputs already spent:
0error code: -25
1error message:
2Input not found or already spent
Note: newly created wallet and txns were used during the test using createrawtransaction
rpc in regtest mode
Also, the functional test LGTM:
0Temporary test directory at /var/folders/jb/wlbrz0t95vl58wzxjt75wqmh0000gn/T/test_runner_₿_🏃_20241219_004940
1Remaining jobs: [rpc_createmultisig.py]
21/1 - rpc_createmultisig.py passed, Duration: 3 s
3
4TEST | STATUS | DURATION
5
6rpc_createmultisig.py | ✓ Passed | 3 s
7
8ALL | ✓ Passed | 3 s (accumulated)
9Runtime: 3 s