mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Add bool PSBTInputSigned
Refactor out a "PSBTInputSigned" function to check if a PSBT is signed,
for use in subsequent commits.
Also improve a related comment.
GitHub-Pull: #14588
Rebased-From: 53e6fffb8f
This commit is contained in:
committed by
Pieter Wuille
parent
70ee1f8709
commit
39ece4fc28
@@ -233,10 +233,14 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
|
||||
return sigdata.complete;
|
||||
}
|
||||
|
||||
bool PSBTInputSigned(PSBTInput& input)
|
||||
{
|
||||
return !input.final_script_sig.empty() || !input.final_script_witness.IsNull();
|
||||
}
|
||||
|
||||
bool SignPSBTInput(const SigningProvider& provider, const CMutableTransaction& tx, PSBTInput& input, SignatureData& sigdata, int index, int sighash)
|
||||
{
|
||||
// if this input has a final scriptsig or scriptwitness, don't do anything with it
|
||||
if (!input.final_script_sig.empty() || !input.final_script_witness.IsNull()) {
|
||||
if (PSBTInputSigned(input)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user