autopilot: use subtractFees when funding channel

To make the autopilot able to account for fees, we let it use the
subtractFees option when opening channels.

This makes sure that each channel we attempt to open will eat at most
Amt out of our budget. Previously fees would eat into our funds in
addition, causing us to deplete our funds more than expected on each
channel opening.
This commit is contained in:
Johan T. Halseth
2019-07-11 13:14:38 +02:00
parent 0405703019
commit bf7f392c11
3 changed files with 7 additions and 4 deletions

View File

@@ -100,6 +100,7 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey,
req := &openChanReq{
targetPubkey: target,
chainHash: *activeNetParams.GenesisHash,
subtractFees: true,
localFundingAmt: amt,
pushAmt: 0,
minHtlc: minHtlc,