mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
stateroot: broadcast state on new blocks
This commit is contained in:
parent
3c65ed1507
commit
2f3abf95a2
9 changed files with 75 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue