network: do async broadcast when processing P2P TX
It can lead to some goroutine explosion, but supposedly it's better than stalling other processing and eventually all of these goroutines should finish their sends. Note that this doesn't change the behavior for RPC-relayed transactions that are still waiting for the broadcast to finish ensuring proper transaction distribution before returning the result to the client.
This commit is contained in:
parent
0fcbc697ca
commit
e5d0125a3f
1 changed files with 1 additions and 1 deletions
|
@ -548,7 +548,7 @@ func (s *Server) handleTxCmd(tx *transaction.Transaction) error {
|
||||||
// in the pool.
|
// in the pool.
|
||||||
if s.verifyAndPoolTX(tx) == RelaySucceed {
|
if s.verifyAndPoolTX(tx) == RelaySucceed {
|
||||||
s.consensus.OnTransaction(tx)
|
s.consensus.OnTransaction(tx)
|
||||||
s.broadcastTX(tx)
|
go s.broadcastTX(tx)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue