Update signing to deal with NULL keystore
This commit is contained in:
@@ -245,7 +245,7 @@ static bool SignStepCC(const BaseSignatureCreator& creator, const CScript& scrip
|
|||||||
// first of priv key in our key store or contract address is what we sign with
|
// first of priv key in our key store or contract address is what we sign with
|
||||||
for (auto pk : p.vKeys)
|
for (auto pk : p.vKeys)
|
||||||
{
|
{
|
||||||
if (creator.KeyStore().GetKey(pk.GetID(), privKey) && privKey.IsValid())
|
if (creator.IsKeystoreValid() && creator.KeyStore().GetKey(pk.GetID(), privKey) && privKey.IsValid())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (pk == CPubKey(ParseHex(C.CChexstr)))
|
if (pk == CPubKey(ParseHex(C.CChexstr)))
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}
|
BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}
|
||||||
const CKeyStore& KeyStore() const { return *keystore; };
|
const bool IsKeystoreValid() const { return keystore != NULL; }
|
||||||
|
const CKeyStore& KeyStore() const { return *keystore; }
|
||||||
virtual ~BaseSignatureCreator() {}
|
virtual ~BaseSignatureCreator() {}
|
||||||
virtual const BaseSignatureChecker& Checker() const =0;
|
virtual const BaseSignatureChecker& Checker() const =0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user