mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
autopilot: rename to Capacity to Balance, define ChannelInfo()
We rename the field Capacity on local channels to Balance, define a new method ChannelInfo on the manager config that let us query the database for our latest channels state. Using this we will use the current local balance instead of the channel capacity when doing allocation calculations.
This commit is contained in:
@@ -49,16 +49,16 @@ func TestConstraintsChannelBudget(t *testing.T) {
|
||||
{
|
||||
[]LocalChannel{
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(prand.Int31()),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(prand.Int31()),
|
||||
},
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(prand.Int31()),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(prand.Int31()),
|
||||
},
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(prand.Int31()),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(prand.Int31()),
|
||||
},
|
||||
},
|
||||
btcutil.Amount(btcutil.SatoshiPerBitcoin * 10),
|
||||
@@ -72,12 +72,12 @@ func TestConstraintsChannelBudget(t *testing.T) {
|
||||
{
|
||||
[]LocalChannel{
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
},
|
||||
btcutil.Amount(btcutil.SatoshiPerBitcoin * 2),
|
||||
@@ -95,8 +95,8 @@ func TestConstraintsChannelBudget(t *testing.T) {
|
||||
{
|
||||
[]LocalChannel{
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
},
|
||||
btcutil.Amount(btcutil.SatoshiPerBitcoin * 9),
|
||||
@@ -115,12 +115,12 @@ func TestConstraintsChannelBudget(t *testing.T) {
|
||||
{
|
||||
[]LocalChannel{
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin * 3),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin * 3),
|
||||
},
|
||||
},
|
||||
btcutil.Amount(btcutil.SatoshiPerBitcoin * 10),
|
||||
@@ -134,12 +134,12 @@ func TestConstraintsChannelBudget(t *testing.T) {
|
||||
{
|
||||
[]LocalChannel{
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
{
|
||||
ChanID: randChanID(),
|
||||
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
ChanID: randChanID(),
|
||||
Balance: btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
},
|
||||
},
|
||||
btcutil.Amount(btcutil.SatoshiPerBitcoin),
|
||||
|
||||
Reference in New Issue
Block a user