Skip to content

Commit

Permalink
fix: Update nLocktime nSequence handling (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdeggen authored Dec 5, 2023
1 parent 33b49c5 commit 92eff98
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spv/spv.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ func ExecuteSimplifiedPaymentVerification(ctx context.Context, dBeef *beef.Decod

func validateLockTime(tx *bt.Tx) error {
if tx.LockTime == 0 {
for _, input := range tx.Inputs {
if input.SequenceNumber != 0xffffffff {
return errors.New("unexpected transaction with nSequence")
}
return nil
}
for _, input := range tx.Inputs {
if input.SequenceNumber != 0xffffffff {
return errors.New("nLocktime is set and nSequence is not max, therefore this could be a non-final tx which is not currently supported.")
}
} else {
return errors.New("unexpected transaction with nLockTime")
}
return nil
}
Expand Down

0 comments on commit 92eff98

Please sign in to comment.