stateroot: broadcast state on new blocks

This commit is contained in:
Evgeniy Stratonikov 2021-03-03 12:37:06 +03:00
parent 3c65ed1507
commit 2f3abf95a2
9 changed files with 75 additions and 36 deletions

View file

@ -1,19 +1,11 @@
package stateroot
import (
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
)
// SetSignAndSendCb sets callback for sending signed root.
func (s *Module) SetSignAndSendCallback(f func(*state.MPTRoot) error) {
s.mtx.Lock()
defer s.mtx.Unlock()
s.signAndSendCb = f
}
// SetUpdateValidatorsCallback sets callback for sending signed root.
func (s *Module) SetUpdateValidatorsCallback(f func(keys.PublicKeys)) {
func (s *Module) SetUpdateValidatorsCallback(f func(uint32, keys.PublicKeys)) {
s.mtx.Lock()
defer s.mtx.Unlock()
s.updateValidatorsCb = f