aboutsummaryrefslogtreecommitdiff
path: root/src/script/sign.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/sign.h')
-rw-r--r--src/script/sign.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/script/sign.h b/src/script/sign.h
index 5384f97539..ab2153e3b9 100644
--- a/src/script/sign.h
+++ b/src/script/sign.h
@@ -187,6 +187,10 @@ struct PSBTInput
int sighash_type = 0;
bool IsNull() const;
+ void FillSignatureData(SignatureData& sigdata) const;
+ void FromSignatureData(const SignatureData& sigdata);
+ void Merge(const PSBTInput& input);
+ bool IsSane() const;
PSBTInput() {}
template <typename Stream>
@@ -375,6 +379,10 @@ struct PSBTOutput
std::map<std::vector<unsigned char>, std::vector<unsigned char>> unknown;
bool IsNull() const;
+ void FillSignatureData(SignatureData& sigdata) const;
+ void FromSignatureData(const SignatureData& sigdata);
+ void Merge(const PSBTOutput& output);
+ bool IsSane() const;
PSBTOutput() {}
template <typename Stream>
@@ -472,6 +480,8 @@ struct PartiallySignedTransaction
std::map<std::vector<unsigned char>, std::vector<unsigned char>> unknown;
bool IsNull() const;
+ void Merge(const PartiallySignedTransaction& psbt);
+ bool IsSane() const;
PartiallySignedTransaction() {}
PartiallySignedTransaction(const PartiallySignedTransaction& psbt_in) : tx(psbt_in.tx), inputs(psbt_in.inputs), outputs(psbt_in.outputs), unknown(psbt_in.unknown) {}
@@ -605,6 +615,10 @@ struct PartiallySignedTransaction
if (outputs.size() != tx->vout.size()) {
throw std::ios_base::failure("Outputs provided does not match the number of outputs in transaction.");
}
+ // Sanity check
+ if (!IsSane()) {
+ throw std::ios_base::failure("PSBT is not sane.");
+ }
}
template <typename Stream>