forked from TrueCloudLab/neoneo-go
network: always pass transactions to consensus process
Consensus can require conflicting transactions and it can require more transactions than mempool can fit, all of this should work. Transactions will be checked anyway using its secondary mempool. See the scenario from #668.
This commit is contained in:
parent
746644a4eb
commit
bc6d6e58bc
2 changed files with 4 additions and 6 deletions
|
@ -965,10 +965,10 @@ func (s *Server) handleTxCmd(tx *transaction.Transaction) error {
|
|||
}
|
||||
s.txInMap[tx.Hash()] = struct{}{}
|
||||
s.txInLock.Unlock()
|
||||
if s.txCallback != nil {
|
||||
s.txCallback(tx)
|
||||
}
|
||||
if s.verifyAndPoolTX(tx) == nil {
|
||||
if s.txCallback != nil {
|
||||
s.txCallback(tx)
|
||||
}
|
||||
s.broadcastTX(tx, nil)
|
||||
}
|
||||
s.txInLock.Lock()
|
||||
|
|
|
@ -474,9 +474,7 @@ func TestTransaction(t *testing.T) {
|
|||
tx := newDummyTx()
|
||||
s.chain.(*fakechain.FakeChain).PoolTxF = func(*transaction.Transaction) error { return core.ErrInsufficientFunds }
|
||||
s.testHandleMessage(t, nil, CMDTX, tx)
|
||||
for _, ftx := range s.services[0].(*fakeConsensus).txs {
|
||||
require.NotEqual(t, ftx, tx)
|
||||
}
|
||||
require.Contains(t, s.services[0].(*fakeConsensus).txs, tx) // Consensus receives everything.
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue