From 0422beb9bdfcd7d1cc095ab681a760d8bc7a1918 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 3 Jul 2018 17:18:52 -0700 Subject: [PATCH] Make SignatureData able to store signatures and scripts In addition to having the scriptSig and scriptWitness, have SignatureData also be able to store just the signatures (pubkeys mapped to sigs) and scripts (script ids mapped to scripts). Also have DataFromTransaction be able to extract signatures and scripts from the scriptSig and scriptWitness of an input to put them in SignatureData. Adds a new SignatureChecker which takes a SignatureData and puts pubkeys and signatures into it when it successfully verifies a signature. Adds a new field in SignatureData which stores whether the SignatureData was complete. This allows us to also update the scriptSig and scriptWitness to the final one when updating a SignatureData with another one. --- src/bench/verify_script.cpp | 1 + src/bitcoin-tx.cpp | 4 +- src/rpc/rawtransaction.cpp | 6 +- src/script/sign.cpp | 130 +++++++++++++++++++++++++++------ src/script/sign.h | 17 ++++- src/test/transaction_tests.cpp | 8 +- 6 files changed, 129 insertions(+), 37 deletions(-) diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index 4100519d48..ae60588c2d 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -9,6 +9,7 @@ #endif #include