Fix TXInput.UnlocksOutputWith

This commit is contained in:
Ivan Kuznetsov 2017-09-10 11:06:12 +07:00
parent fc0c819c43
commit 843858dc37
1 changed files with 3 additions and 1 deletions

View File

@ -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
}