Fix TXInput.UnlocksOutputWith
This commit is contained in:
parent
fc0c819c43
commit
843858dc37
|
@ -11,7 +11,9 @@ type TXInput struct {
|
||||||
|
|
||||||
// UnlocksOutputWith checks whether the address initiated the transaction
|
// UnlocksOutputWith checks whether the address initiated the transaction
|
||||||
func (in *TXInput) UnlocksOutputWith(pubKeyHash []byte) bool {
|
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
|
return bytes.Compare(lockingHash, pubKeyHash) == 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue