mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
New PartiallySignedTransaction constructor from CTransction
New constructor that creates a PartiallySignedTransaction from a CTransaction, automatically sizing the inputs and outputs vectors for convenience.
This commit is contained in:
@@ -513,6 +513,12 @@ bool IsSolvable(const SigningProvider& provider, const CScript& script)
|
||||
return false;
|
||||
}
|
||||
|
||||
PartiallySignedTransaction::PartiallySignedTransaction(const CTransaction& tx) : tx(tx)
|
||||
{
|
||||
inputs.resize(tx.vin.size());
|
||||
outputs.resize(tx.vout.size());
|
||||
}
|
||||
|
||||
bool PartiallySignedTransaction::IsNull() const
|
||||
{
|
||||
return !tx && inputs.empty() && outputs.empty() && unknown.empty();
|
||||
|
||||
@@ -566,6 +566,7 @@ struct PartiallySignedTransaction
|
||||
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) {}
|
||||
explicit PartiallySignedTransaction(const CTransaction& tx);
|
||||
|
||||
// Only checks if they refer to the same transaction
|
||||
friend bool operator==(const PartiallySignedTransaction& a, const PartiallySignedTransaction &b)
|
||||
|
||||
Reference in New Issue
Block a user