From d40f06a3da5e6b1fd065885b08513263fa930cb8 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 17 Mar 2018 19:19:09 -0700 Subject: [PATCH] Introduce interface for signing providers CKeyStore is a rich interface that provides many features, including knowledge of scripts and pubkeys for solving, private keys for signing, in addition to watch-only keys and scripts, and distinguishing lack of keys from them just being encrypted. The signing logic in script/sign does not actually need most of these features. Here we introduce a simpler interface (SigningProvider) which *only* provides keys and scripts. This is actually sufficient for signing. In addtion, we swap the dependency between keystore and script/sign (keystore now depends on script/script with CKeyStore deriving from SigningProvider, rather than CKeyStore being the interface that signing relies on). --- src/keystore.h | 8 ++------ src/script/sign.cpp | 23 +++++++++++------------ src/script/sign.h | 33 ++++++++++++++++++++++----------- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/keystore.h b/src/keystore.h index ffd3238fd..ff5613f61 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -9,35 +9,31 @@ #include #include #include