Skip to content

Commit 41c607f

Browse files
committed
Implement PSBT Structures and un/serialization methods per BIP 174
1 parent 287e4ed commit 41c607f

File tree

3 files changed

+555
-0
lines changed

3 files changed

+555
-0
lines changed

src/pubkey.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class CPubKey
107107

108108
//! Simple read-only vector-like interface to the pubkey data.
109109
unsigned int size() const { return GetLen(vch[0]); }
110+
const unsigned char* data() const { return vch; }
110111
const unsigned char* begin() const { return vch; }
111112
const unsigned char* end() const { return vch + size(); }
112113
const unsigned char& operator[](unsigned int pos) const { return vch[pos]; }

src/script/sign.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,19 @@ bool IsSolvable(const SigningProvider& provider, const CScript& script)
429429
}
430430
return false;
431431
}
432+
433+
434+
bool PartiallySignedTransaction::IsNull() const
435+
{
436+
return !tx && inputs.empty() && outputs.empty() && unknown.empty();
437+
}
438+
439+
bool PSBTInput::IsNull() const
440+
{
441+
return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
442+
}
443+
444+
bool PSBTOutput::IsNull() const
445+
{
446+
return redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
447+
}

0 commit comments

Comments
 (0)