Merge pull request #3257 from nspcc-dev/check-init

rpcclient: check network initialisation for blocks subscriptions
This commit is contained in:
Roman Khimov 2023-12-08 22:40:08 +03:00 committed by GitHub
commit afca64f164
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -732,6 +732,9 @@ func (c *WSClient) ReceiveBlocks(flt *neorpc.BlockFilter, rcvr chan<- *block.Blo
if rcvr == nil {
return "", ErrNilNotificationReceiver
}
if !c.cache.initDone {
return "", errNetworkNotInitialized
}
params := []any{"block_added"}
if flt != nil {
flt = flt.Copy()