Skip to content

Commit 6d0bd81

Browse files
authored
Revert "core/quorum: check if transaction was already applied" (#33)
1 parent d400d62 commit 6d0bd81

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

core/quorum/block_maker.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type pendingState struct {
2626
gp *core.GasPool
2727
ownedAccounts *set.Set
2828
txs types.Transactions // set of transactions
29-
txsHashes *set.Set
3029
lowGasTxs types.Transactions
3130
failedTxs types.Transactions
3231
parent *types.Block
@@ -56,7 +55,6 @@ func (ps *pendingState) applyTransaction(tx *types.Transaction, bc *core.BlockCh
5655
return err, nil
5756
}
5857
ps.txs = append(ps.txs, tx)
59-
ps.txsHashes.Add(tx.Hash())
6058
ps.receipts = append(ps.receipts, receipt)
6159

6260
return nil, logs
@@ -75,11 +73,6 @@ func (ps *pendingState) applyTransactions(txs *types.TransactionsByPriorityAndNo
7573
if tx == nil {
7674
break
7775
}
78-
79-
if ps.txsHashes.Has(tx.Hash()) {
80-
continue
81-
}
82-
8376
// Error may be ignored here. The error has already been checked
8477
// during transaction acceptance is the transaction pool.
8578
from, _ := tx.From()

core/quorum/block_voting.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func (bv *BlockVoting) resetPendingState(parent *types.Block) {
110110
header: bv.makeHeader(parent),
111111
gp: new(core.GasPool),
112112
ownedAccounts: accountAddressesSet(bv.am.Accounts()),
113-
txsHashes: set.New(),
114113
}
115114

116115
ps.gp.AddGas(ps.header.GasLimit)
@@ -311,11 +310,9 @@ func (bv *BlockVoting) createBlock() (*types.Block, error) {
311310

312311
ch, err := bv.canonHash(bv.pState.header.Number.Uint64())
313312
if err != nil {
314-
bv.resetPendingState(bv.bc.CurrentFastBlock())
315313
return nil, err
316314
}
317315
if ch != bv.pState.parent.Hash() {
318-
bv.resetPendingState(bv.bc.CurrentFastBlock())
319316
return nil, fmt.Errorf("invalid canonical hash, expected %s got %s", ch.Hex(), bv.pState.header.Hash().Hex())
320317
}
321318

0 commit comments

Comments
 (0)