Merge pull request #1913 from acruikshank/feat/1853-confirmations-in-StateWaitMsg2

Add confidence and timeout to message wait
This commit is contained in:
Łukasz Magiera
2020-06-04 23:23:15 +02:00
committed by GitHub
18 changed files with 75 additions and 38 deletions
+2 -4
View File
@@ -344,10 +344,8 @@ func (a *StateAPI) MinerCreateBlock(ctx context.Context, bt *api.BlockTemplate)
return &out, nil
}
func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
// TODO: consider using event system for this, expose confidence
ts, recpt, err := a.StateManager.WaitForMessage(ctx, msg)
func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) {
ts, recpt, err := a.StateManager.WaitForMessage(ctx, msg, confidence)
if err != nil {
return nil, err
}