aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.cpp
diff options
context:
space:
mode:
authorGlenn Willen <gwillen@nerdnet.org>2020-05-29 01:25:04 -0700
committerGlenn Willen <gwillen@nerdnet.org>2020-06-19 02:20:04 -0700
commita6cb0b0c29d327d01aebb98b0504f317eb19c3dc (patch)
treebb6310a7677bb704e256521eaae23c48d5586817 /src/psbt.cpp
parent5dd0c03ffa3aeaa69d8a3a716f902f450d5eaaec (diff)
[gui] PSBT Operations Dialog (sign & broadcast)
Add a "PSBT Operations" dialog, reached from the "Load PSBT..." menu item, giving options to sign or broadcast the loaded PSBT as appropriate, as well as copying the result to the clipboard or saving it to a file.
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r--src/psbt.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp
index ef9781817a..10260740f0 100644
--- a/src/psbt.cpp
+++ b/src/psbt.cpp
@@ -214,6 +214,17 @@ bool PSBTInputSigned(const PSBTInput& input)
return !input.final_script_sig.empty() || !input.final_script_witness.IsNull();
}
+size_t CountPSBTUnsignedInputs(const PartiallySignedTransaction& psbt) {
+ size_t count = 0;
+ for (const auto& input : psbt.inputs) {
+ if (!PSBTInputSigned(input)) {
+ count++;
+ }
+ }
+
+ return count;
+}
+
void UpdatePSBTOutput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index)
{
const CTxOut& out = psbt.tx->vout.at(index);