payments/p2wpkh: fix exception messages
This commit is contained in:
parent
35e0956ed9
commit
0d9619aeed
2 changed files with 11 additions and 5 deletions
src/payments
|
@ -118,9 +118,9 @@ function p2wpkh (a, opts) {
|
|||
}
|
||||
|
||||
if (a.witness) {
|
||||
if (a.witness.length !== 2) throw new TypeError('Input is invalid')
|
||||
if (!bscript.isCanonicalScriptSignature(a.witness[0])) throw new TypeError('Input has invalid signature')
|
||||
if (!ecc.isPoint(a.witness[1])) throw new TypeError('Input has invalid pubkey')
|
||||
if (a.witness.length !== 2) throw new TypeError('Witness is invalid')
|
||||
if (!bscript.isCanonicalScriptSignature(a.witness[0])) throw new TypeError('Witness has invalid signature')
|
||||
if (!ecc.isPoint(a.witness[1])) throw new TypeError('Witness has invalid pubkey')
|
||||
|
||||
if (a.signature && !a.signature.equals(a.witness[0])) throw new TypeError('Signature mismatch')
|
||||
if (a.pubkey && !a.pubkey.equals(a.witness[1])) throw new TypeError('Pubkey mismatch')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue