From 7c381d469b722361d55c777d8f3908bf9f0b987e Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Fri, 22 Mar 2024 12:19:01 +0100 Subject: [PATCH] Remove check if a block has its own tx as a payload spender since we always fork on conflicts This avoid re-encoding the transaction to calculate the ID --- pkg/protocol/engine/booker/inmemorybooker/booker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/protocol/engine/booker/inmemorybooker/booker.go b/pkg/protocol/engine/booker/inmemorybooker/booker.go index 1e15d5cf5..aa7da90ca 100644 --- a/pkg/protocol/engine/booker/inmemorybooker/booker.go +++ b/pkg/protocol/engine/booker/inmemorybooker/booker.go @@ -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()) }