Changeset View
Changeset View
Standalone View
Standalone View
src/psbt.cpp
Show All 35 Lines | bool PartiallySignedTransaction::IsSane() const { | ||||
for (PSBTInput input : inputs) { | for (PSBTInput input : inputs) { | ||||
if (!input.IsSane()) { | if (!input.IsSane()) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool PartiallySignedTransaction::AddInput(const CTxIn &txin, | |||||
PSBTInput &psbtin) { | |||||
if (std::find(tx->vin.begin(), tx->vin.end(), txin) != tx->vin.end()) { | |||||
return false; | |||||
} | |||||
tx->vin.push_back(txin); | |||||
psbtin.partial_sigs.clear(); | |||||
psbtin.final_script_sig.clear(); | |||||
inputs.push_back(psbtin); | |||||
return true; | |||||
} | |||||
bool PartiallySignedTransaction::AddOutput(const CTxOut &txout, | |||||
const PSBTOutput &psbtout) { | |||||
tx->vout.push_back(txout); | |||||
outputs.push_back(psbtout); | |||||
return true; | |||||
} | |||||
bool PSBTInput::IsNull() const { | bool PSBTInput::IsNull() const { | ||||
return utxo.IsNull() && partial_sigs.empty() && unknown.empty() && | return utxo.IsNull() && partial_sigs.empty() && unknown.empty() && | ||||
hd_keypaths.empty() && redeem_script.empty(); | hd_keypaths.empty() && redeem_script.empty(); | ||||
} | } | ||||
void PSBTInput::FillSignatureData(SignatureData &sigdata) const { | void PSBTInput::FillSignatureData(SignatureData &sigdata) const { | ||||
if (!final_script_sig.empty()) { | if (!final_script_sig.empty()) { | ||||
sigdata.scriptSig = final_script_sig; | sigdata.scriptSig = final_script_sig; | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |