99
1010 "github.com/ava-labs/avalanchego/chains/atomic"
1111 "github.com/ava-labs/avalanchego/ids"
12- "github.com/ava-labs/avalanchego/utils/set"
1312 "github.com/ava-labs/avalanchego/vms/platformvm/block"
1413 "github.com/ava-labs/avalanchego/vms/platformvm/state"
1514 "github.com/ava-labs/avalanchego/vms/platformvm/status"
2625 errIncorrectBlockHeight = errors .New ("incorrect block height" )
2726 errChildBlockEarlierThanParent = errors .New ("proposed timestamp before current chain time" )
2827 errConflictingBatchTxs = errors .New ("block contains conflicting transactions" )
29- errConflictingParentTxs = errors .New ("block contains a transaction that conflicts with a transaction in a parent block" )
3028 errOptionBlockTimestampNotMatchingParent = errors .New ("option block proposed timestamp not matching parent block one" )
3129)
3230
@@ -203,7 +201,7 @@ func (v *verifier) ApricotAtomicBlock(b *block.ApricotAtomicBlock) error {
203201
204202 atomicExecutor .OnAccept .AddTx (b .Tx , status .Committed )
205203
206- if err := v .verifyUniqueInputs (b , atomicExecutor .Inputs ); err != nil {
204+ if err := v .verifyUniqueInputs (b . Parent () , atomicExecutor .Inputs ); err != nil {
207205 return err
208206 }
209207
@@ -441,7 +439,7 @@ func (v *verifier) standardBlock(
441439 }
442440 }
443441
444- if err := v .verifyUniqueInputs (b , blkState .inputs ); err != nil {
442+ if err := v .verifyUniqueInputs (b . Parent () , blkState .inputs ); err != nil {
445443 return err
446444 }
447445
@@ -461,28 +459,3 @@ func (v *verifier) standardBlock(
461459 v .Mempool .Remove (b .Transactions )
462460 return nil
463461}
464-
465- // verifyUniqueInputs verifies that the inputs of the given block are not
466- // duplicated in any of the parent blocks pinned in memory.
467- func (v * verifier ) verifyUniqueInputs (block block.Block , inputs set.Set [ids.ID ]) error {
468- if inputs .Len () == 0 {
469- return nil
470- }
471-
472- // Check for conflicts in ancestors.
473- for {
474- parentID := block .Parent ()
475- parentState , ok := v .blkIDToState [parentID ]
476- if ! ok {
477- // The parent state isn't pinned in memory.
478- // This means the parent must be accepted already.
479- return nil
480- }
481-
482- if parentState .inputs .Overlaps (inputs ) {
483- return errConflictingParentTxs
484- }
485-
486- block = parentState .statelessBlock
487- }
488- }
0 commit comments