Do not process txns if node out of sync (#3958)

* Do not process txns if node out of sync

* fix rpc test
pull/3968/head
Rongjian Lan 3 years ago committed by GitHub
parent 3429bb5404
commit 4c9546a4d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      node/node.go

@ -195,6 +195,12 @@ func (node *Node) tryBroadcastStaking(stakingTx *staking.StakingTransaction) {
// Add new transactions to the pending transaction list.
func (node *Node) addPendingTransactions(newTxs types.Transactions) []error {
if inSync, _, _ := node.SyncStatus(node.Blockchain().ShardID()); !inSync && node.NodeConfig.GetNetworkType() == nodeconfig.Mainnet {
utils.Logger().Debug().
Int("length of newTxs", len(newTxs)).
Msg("[addPendingTransactions] Node out of sync, ignoring transactions")
return nil
}
poolTxs := types.PoolTransactions{}
errs := []error{}
acceptCx := node.Blockchain().Config().AcceptsCrossTx(node.Blockchain().CurrentHeader().Epoch())

Loading…
Cancel
Save