[#457] innerring: wait until notary tx persists on chain

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-04-27 14:07:06 +03:00 committed by Alex Vanin
parent 60d74bce67
commit 5b85519f20
4 changed files with 31 additions and 18 deletions

View file

@ -1,6 +1,7 @@
package innerring
import (
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/alphabet"
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap"
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement"
@ -47,7 +48,7 @@ type (
notaryDepositArgs struct {
l *zap.Logger
depositor func() error
depositor func() (util.Uint256, error)
notaryDuration uint32 // in blocks
}
@ -144,7 +145,7 @@ func newNotaryDepositTimer(args *notaryDepositArgs) *timer.BlockTimer {
return timer.NewBlockTimer(
timer.StaticBlockMeter(args.notaryDuration),
func() {
err := args.depositor()
_, err := args.depositor()
if err != nil {
args.l.Warn("can't deposit notary contract",
zap.String("error", err.Error()))