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
|
@ -119,8 +119,12 @@ func (c *Client) Init() error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed to get network magic: %w", err)
|
||||
}
|
||||
c.network = version.Magic
|
||||
c.stateRootInHeader = version.StateRootInHeader
|
||||
c.network = version.Protocol.Network
|
||||
c.stateRootInHeader = version.Protocol.StateRootInHeader
|
||||
if version.Protocol.MillisecondsPerBlock == 0 {
|
||||
c.network = version.Magic
|
||||
c.stateRootInHeader = version.StateRootInHeader
|
||||
}
|
||||
neoContractHash, err := c.GetContractStateByAddressOrName(nativenames.Neo)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get NEO contract scripthash: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue