Implement PSBT Structures and un/serialization methods per BIP 174

This commit is contained in:
Andrew Chow
2018-06-27 16:53:48 -07:00
parent 287e4edc2f
commit 41c607f09b
3 changed files with 555 additions and 0 deletions

View File

@@ -429,3 +429,19 @@ bool IsSolvable(const SigningProvider& provider, const CScript& script)
}
return false;
}
bool PartiallySignedTransaction::IsNull() const
{
return !tx && inputs.empty() && outputs.empty() && unknown.empty();
}
bool PSBTInput::IsNull() const
{
return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
}
bool PSBTOutput::IsNull() const
{
return redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
}