Skip to content

Commit

Permalink
Remove check if a block has its own tx as a payload spender since we …
Browse files Browse the repository at this point in the history
…always fork on conflicts

This avoid re-encoding the transaction to calculate the ID
  • Loading branch information
alexsporn committed Mar 22, 2024
1 parent 49f6936 commit 7c381d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/protocol/engine/booker/inmemorybooker/booker.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (b *Booker) inheritSpenders(block *blocks.Block) (spenderIDs ds.Set[iotago.

// Check whether the parent contains a conflicting TX,
// otherwise reference is invalid and the block should be marked as invalid as well.
if signedTransaction, hasTx := parentBlock.SignedTransaction(); !hasTx || !parentBlock.PayloadSpenderIDs().Has(signedTransaction.Transaction.MustID()) {
if _, hasTx := parentBlock.SignedTransaction(); !hasTx {
return nil, ierrors.Wrapf(err, "shallow like parent %s does not contain a conflicting transaction", parent.ID.String())
}

Expand Down

0 comments on commit 7c381d4

Please sign in to comment.