Skip to content

Commit

Permalink
Revert "core/quorum: check if transaction was already applied" (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmn authored Dec 20, 2016
1 parent d400d62 commit 6d0bd81
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
7 changes: 0 additions & 7 deletions core/quorum/block_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type pendingState struct {
gp *core.GasPool
ownedAccounts *set.Set
txs types.Transactions // set of transactions
txsHashes *set.Set
lowGasTxs types.Transactions
failedTxs types.Transactions
parent *types.Block
Expand Down Expand Up @@ -56,7 +55,6 @@ func (ps *pendingState) applyTransaction(tx *types.Transaction, bc *core.BlockCh
return err, nil
}
ps.txs = append(ps.txs, tx)
ps.txsHashes.Add(tx.Hash())
ps.receipts = append(ps.receipts, receipt)

return nil, logs
Expand All @@ -75,11 +73,6 @@ func (ps *pendingState) applyTransactions(txs *types.TransactionsByPriorityAndNo
if tx == nil {
break
}

if ps.txsHashes.Has(tx.Hash()) {
continue
}

// Error may be ignored here. The error has already been checked
// during transaction acceptance is the transaction pool.
from, _ := tx.From()
Expand Down
3 changes: 0 additions & 3 deletions core/quorum/block_voting.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func (bv *BlockVoting) resetPendingState(parent *types.Block) {
header: bv.makeHeader(parent),
gp: new(core.GasPool),
ownedAccounts: accountAddressesSet(bv.am.Accounts()),
txsHashes: set.New(),
}

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

ch, err := bv.canonHash(bv.pState.header.Number.Uint64())
if err != nil {
bv.resetPendingState(bv.bc.CurrentFastBlock())
return nil, err
}
if ch != bv.pState.parent.Hash() {
bv.resetPendingState(bv.bc.CurrentFastBlock())
return nil, fmt.Errorf("invalid canonical hash, expected %s got %s", ch.Hex(), bv.pState.header.Hash().Hex())
}

Expand Down

0 comments on commit 6d0bd81

Please sign in to comment.