rpc: return protocol parameters in getversion
, fix #2160
`StateRootInHeader` is duplicated similarly to `Network`. It will be removed in future as it is surely a protocol parameter. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
63e00ac128
commit
c465b18cb2
4 changed files with 53 additions and 4 deletions
|
@ -520,12 +520,25 @@ func (s *Server) getVersion(_ request.Params) (interface{}, *response.Error) {
|
|||
if err != nil {
|
||||
return nil, response.NewInternalServerError("Cannot fetch tcp port", err)
|
||||
}
|
||||
|
||||
cfg := s.chain.GetConfig()
|
||||
return result.Version{
|
||||
Magic: s.network,
|
||||
TCPPort: port,
|
||||
Nonce: s.coreServer.ID(),
|
||||
UserAgent: s.coreServer.UserAgent,
|
||||
StateRootInHeader: s.chain.GetConfig().StateRootInHeader,
|
||||
StateRootInHeader: cfg.StateRootInHeader,
|
||||
Protocol: result.Protocol{
|
||||
AddressVersion: address.NEO3Prefix,
|
||||
Network: cfg.Magic,
|
||||
MillisecondsPerBlock: cfg.SecondsPerBlock * 1000,
|
||||
MaxTraceableBlocks: cfg.MaxTraceableBlocks,
|
||||
MaxValidUntilBlockIncrement: cfg.MaxValidUntilBlockIncrement,
|
||||
MaxTransactionsPerBlock: cfg.MaxTransactionsPerBlock,
|
||||
MemoryPoolMaxTransactions: cfg.MemPoolSize,
|
||||
InitialGasDistribution: cfg.InitialGASSupply,
|
||||
StateRootInHeader: cfg.StateRootInHeader,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue