rpc: log the reason of submitblock rejection

This commit is contained in:
Roy Lee 2022-04-19 18:41:17 -07:00
parent 3f3752628d
commit 9b313b3914

View file

@ -3882,6 +3882,7 @@ func handleSubmitBlock(s *rpcServer, cmd interface{}, closeChan <-chan struct{})
// nodes. This will in turn relay it to the network like normal.
_, err = s.cfg.SyncMgr.SubmitBlock(block, blockchain.BFNone)
if err != nil {
rpcsLog.Infof("Rejected block %s via submitblock: %s", block.Hash(), err)
return fmt.Sprintf("rejected: %s", err.Error()), nil
}