sweep+lnrpc: add new interface FeePreference
This commit adds a new interface `FeePreference` which makes it easier to write unit tests and allows more customized implementation in following commits.
This commit is contained in:
6 files changed
+108
-21
No files matched your search
@@ -884,7 +884,13 @@ func (w *WalletKit) PendingSweeps(ctx context.Context,
|
||||
broadcastAttempts := uint32(pendingInput.BroadcastAttempts)
|
||||
nextBroadcastHeight := uint32(pendingInput.NextBroadcastHeight)
|
||||
|
||||
requestedFee := pendingInput.Params.Fee
|
||||
feePref := pendingInput.Params.Fee
|
||||
requestedFee, ok := feePref.(sweep.FeeEstimateInfo)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unknown fee preference type: "+
|
||||
"%v", feePref)
|
||||
}
|
||||
|
||||
requestedFeeRate := uint64(requestedFee.FeeRate.FeePerVByte())
|
||||
|
||||
rpcPendingSweeps = append(rpcPendingSweeps, &PendingSweep{
|
||||
|
||||
Reference in new issue
Block a user