Create Signer interface and use it

This commit is contained in:
junderw 2019-06-14 15:25:07 +09:00
parent 1cc7205e9c
commit 691e4d15d1
No known key found for this signature in database
GPG key ID: B256185D3A971908
7 changed files with 42 additions and 20 deletions

View file

@ -1007,7 +1007,8 @@ function getSigningData(
) {
throw new Error('Inconsistent redeemScript');
}
const ourPubKey = keyPair.publicKey || keyPair.getPublicKey();
const ourPubKey =
keyPair.publicKey || (keyPair.getPublicKey && keyPair.getPublicKey());
if (!canSign(input)) {
if (witnessValue !== undefined) {
if (input.value !== undefined && input.value !== witnessValue)