don't wait for msg to land on chain
This commit is contained in:
+2
-12
@@ -1283,7 +1283,7 @@ func (sm *StorageMinerAPI) RuntimeSubsystems(context.Context) (res api.MinerSubs
|
||||
return sm.EnabledSubsystems, nil
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) WithdrawBalance(ctx context.Context, amount abi.TokenAmount, confidence uint64) (cid.Cid, error) {
|
||||
func (sm *StorageMinerAPI) WithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) {
|
||||
available, err := sm.Full.StateMinerAvailableBalance(ctx, sm.Miner.Address(), types.EmptyTSK)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("Error getting miner balance: %w", err)
|
||||
@@ -1320,15 +1320,5 @@ func (sm *StorageMinerAPI) WithdrawBalance(ctx context.Context, amount abi.Token
|
||||
return cid.Undef, err
|
||||
}
|
||||
|
||||
// wait for it to get mined into a block
|
||||
wait, err := sm.Full.StateWaitMsg(ctx, smsg.Cid(), confidence, abi.ChainEpoch(2), true)
|
||||
if err != nil {
|
||||
return smsg.Cid(), xerrors.Errorf("Timeout waiting for withdrawal message")
|
||||
}
|
||||
|
||||
if wait.Receipt.ExitCode != 0 {
|
||||
return wait.Message, xerrors.Errorf("Failed to execute withdrawal message: %w", err)
|
||||
}
|
||||
|
||||
return wait.Message, nil
|
||||
return smsg.Cid(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user