mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Mark PSBTs spending unspendable outputs as invalid in analysis
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <node/psbt.h>
|
||||
#include <policy/policy.h>
|
||||
#include <policy/settings.h>
|
||||
#include <tinyformat.h>
|
||||
|
||||
#include <numeric>
|
||||
|
||||
@@ -39,6 +40,11 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
calc_fee = false;
|
||||
}
|
||||
|
||||
if (!utxo.IsNull() && utxo.scriptPubKey.IsUnspendable()) {
|
||||
result.SetInvalid(strprintf("PSBT is not valid. Input %u spends unspendable output", i));
|
||||
return result;
|
||||
}
|
||||
|
||||
// Check if it is final
|
||||
if (!utxo.IsNull() && !PSBTInputSigned(input)) {
|
||||
input_analysis.is_final = false;
|
||||
|
||||
Reference in New Issue
Block a user