multi: add coin selection strategy option to all on-chain rpcs

In this commit, we add the coin selection strategy option to the following
on-chain RPCs `fundpsbt`, `batchopenchannel`, `estimatefee`, `sendcoins`,
`sendmany`, and `sendoutputs`.
This commit is contained in:
Mohamed Awnallah
2024-03-26 19:08:27 +02:00
parent a0b0e7aa62
commit 1a2d50d385
11 changed files with 107 additions and 40 deletions

View File

@@ -73,7 +73,8 @@ var (
// This is a part of the WalletController interface.
func (b *BtcWallet) FundPsbt(packet *psbt.Packet, minConfs int32,
feeRate chainfee.SatPerKWeight, accountName string,
changeScope *waddrmgr.KeyScope) (int32, error) {
changeScope *waddrmgr.KeyScope,
strategy wallet.CoinSelectionStrategy) (int32, error) {
// The fee rate is passed in using units of sat/kw, so we'll convert
// this to sat/KB as the CreateSimpleTx method requires this unit.
@@ -134,7 +135,7 @@ func (b *BtcWallet) FundPsbt(packet *psbt.Packet, minConfs int32,
// the partial TX information in the packet.
return b.wallet.FundPsbt(
packet, keyScope, minConfs, accountNum, feeSatPerKB,
b.cfg.CoinSelectionStrategy, opts...,
strategy, opts...,
)
}