rpc: fix bug in Actor's waiter

Execution events are followed by block events, not vise versa, thus,
we can wait until VUB block to be accepted to be sure that
transaction wasn't accepted to chain.
This commit is contained in:
Anna Shaleva 2022-10-26 10:31:25 +03:00
parent 0a5905390c
commit 5811687836

View file

@ -244,8 +244,8 @@ func (w *EventWaiter) WaitAny(ctx context.Context, vub uint32, hashes ...util.Ui
close(aerRcvr)
}
}()
// Execution event follows the block event, thus wait until the block next to the VUB to be sure.
since := vub + 1
// Execution event precedes the block event, thus wait until the VUB-th block to be sure.
since := vub
blocksID, err := w.ws.ReceiveBlocks(&neorpc.BlockFilter{Since: &since}, bRcvr)
if err != nil {
wsWaitErr = fmt.Errorf("failed to subscribe for new blocks: %w", err)