Skip to content

Commit bc4cd20

Browse files
author
David Case
committed
fix verify
1 parent 2256c96 commit bc4cd20

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spv/verify.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,10 @@ func Verify(t *transaction.Transaction,
5454

5555
inputTotal := uint64(0)
5656
for vin, input := range tx.Inputs {
57-
if input.SourceTransaction == nil {
57+
sourceOutput := input.SourceTxOutput()
58+
if sourceOutput == nil {
5859
return false, fmt.Errorf("input %d has no source transaction", vin)
5960
}
60-
if input.UnlockingScript == nil || len(*input.UnlockingScript) == 0 {
61-
return false, fmt.Errorf("input %d has no unlocking script", vin)
62-
}
63-
sourceOutput := input.SourceTransaction.Outputs[input.SourceTxOutIndex]
6461
inputTotal += sourceOutput.Satoshis
6562
sourceTxid := input.SourceTransaction.TxID().String()
6663
if _, ok := verifiedTxids[sourceTxid]; !ok {

0 commit comments

Comments
 (0)