mirror of https://github.com/poanetwork/quorum.git
Revert "core/quorum: check if transaction was already applied" (#33)
This commit is contained in:
parent
d400d62448
commit
6d0bd81048
|
@ -26,7 +26,6 @@ type pendingState struct {
|
||||||
gp *core.GasPool
|
gp *core.GasPool
|
||||||
ownedAccounts *set.Set
|
ownedAccounts *set.Set
|
||||||
txs types.Transactions // set of transactions
|
txs types.Transactions // set of transactions
|
||||||
txsHashes *set.Set
|
|
||||||
lowGasTxs types.Transactions
|
lowGasTxs types.Transactions
|
||||||
failedTxs types.Transactions
|
failedTxs types.Transactions
|
||||||
parent *types.Block
|
parent *types.Block
|
||||||
|
@ -56,7 +55,6 @@ func (ps *pendingState) applyTransaction(tx *types.Transaction, bc *core.BlockCh
|
||||||
return err, nil
|
return err, nil
|
||||||
}
|
}
|
||||||
ps.txs = append(ps.txs, tx)
|
ps.txs = append(ps.txs, tx)
|
||||||
ps.txsHashes.Add(tx.Hash())
|
|
||||||
ps.receipts = append(ps.receipts, receipt)
|
ps.receipts = append(ps.receipts, receipt)
|
||||||
|
|
||||||
return nil, logs
|
return nil, logs
|
||||||
|
@ -75,11 +73,6 @@ func (ps *pendingState) applyTransactions(txs *types.TransactionsByPriorityAndNo
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if ps.txsHashes.Has(tx.Hash()) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error may be ignored here. The error has already been checked
|
// Error may be ignored here. The error has already been checked
|
||||||
// during transaction acceptance is the transaction pool.
|
// during transaction acceptance is the transaction pool.
|
||||||
from, _ := tx.From()
|
from, _ := tx.From()
|
||||||
|
|
|
@ -110,7 +110,6 @@ func (bv *BlockVoting) resetPendingState(parent *types.Block) {
|
||||||
header: bv.makeHeader(parent),
|
header: bv.makeHeader(parent),
|
||||||
gp: new(core.GasPool),
|
gp: new(core.GasPool),
|
||||||
ownedAccounts: accountAddressesSet(bv.am.Accounts()),
|
ownedAccounts: accountAddressesSet(bv.am.Accounts()),
|
||||||
txsHashes: set.New(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ps.gp.AddGas(ps.header.GasLimit)
|
ps.gp.AddGas(ps.header.GasLimit)
|
||||||
|
@ -311,11 +310,9 @@ func (bv *BlockVoting) createBlock() (*types.Block, error) {
|
||||||
|
|
||||||
ch, err := bv.canonHash(bv.pState.header.Number.Uint64())
|
ch, err := bv.canonHash(bv.pState.header.Number.Uint64())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
bv.resetPendingState(bv.bc.CurrentFastBlock())
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if ch != bv.pState.parent.Hash() {
|
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())
|
return nil, fmt.Errorf("invalid canonical hash, expected %s got %s", ch.Hex(), bv.pState.header.Hash().Hex())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue