From 843858dc3739e2067555b34f5839ee9788cfde5a Mon Sep 17 00:00:00 2001 From: Ivan Kuznetsov Date: Sun, 10 Sep 2017 11:06:12 +0700 Subject: [PATCH] Fix TXInput.UnlocksOutputWith --- transaction_input.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transaction_input.go b/transaction_input.go index 1c57c2b..e64e9e6 100644 --- a/transaction_input.go +++ b/transaction_input.go @@ -11,7 +11,9 @@ type TXInput struct { // UnlocksOutputWith checks whether the address initiated the transaction func (in *TXInput) UnlocksOutputWith(pubKeyHash []byte) bool { - lockingHash := HashPubKey(in.ScriptSig) + sigLen := 64 + pubKey := in.ScriptSig[sigLen:] + lockingHash := HashPubKey(pubKey) return bytes.Compare(lockingHash, pubKeyHash) == 0 }