From 847927af74a53133ef77a734d9ff4da48e107224 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 6 May 2021 22:29:19 +0300 Subject: [PATCH] stateroot: s/onValidatedRoot/relayExtensible/ Makes more sense because it's not just roots that we're relaying. --- pkg/services/stateroot/network.go | 2 +- pkg/services/stateroot/service.go | 4 ++-- pkg/services/stateroot/validators.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/services/stateroot/network.go b/pkg/services/stateroot/network.go index 28322a239..185ec2951 100644 --- a/pkg/services/stateroot/network.go +++ b/pkg/services/stateroot/network.go @@ -95,5 +95,5 @@ func (s *service) sendValidatedRoot(r *state.MPTRoot, acc *wallet.Account) { buf := io.NewBufBinWriter() emit.Bytes(buf.BinWriter, sig) ep.Witness.InvocationScript = buf.Bytes() - s.onValidatedRoot(ep) + s.relayExtensible(ep) } diff --git a/pkg/services/stateroot/service.go b/pkg/services/stateroot/service.go index 694d9fd99..636702450 100644 --- a/pkg/services/stateroot/service.go +++ b/pkg/services/stateroot/service.go @@ -45,7 +45,7 @@ type ( srMtx sync.Mutex incompleteRoots map[uint32]*incompleteRoot - onValidatedRoot RelayCallback + relayExtensible RelayCallback blockCh chan *block.Block done chan struct{} } @@ -66,7 +66,7 @@ func New(cfg config.StateRoot, log *zap.Logger, bc blockchainer.Blockchainer, cb incompleteRoots: make(map[uint32]*incompleteRoot), blockCh: make(chan *block.Block), done: make(chan struct{}), - onValidatedRoot: cb, + relayExtensible: cb, } s.MainCfg = cfg diff --git a/pkg/services/stateroot/validators.go b/pkg/services/stateroot/validators.go index a364ea6a5..d33d0f5fc 100644 --- a/pkg/services/stateroot/validators.go +++ b/pkg/services/stateroot/validators.go @@ -91,7 +91,7 @@ func (s *service) signAndSend(r *state.MPTRoot) error { buf := io.NewBufBinWriter() emit.Bytes(buf.BinWriter, sig) e.Witness.InvocationScript = buf.Bytes() - s.onValidatedRoot(e) + s.relayExtensible(e) return nil }