mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
wallet: Actually load wallet stats when asked to
The call to `sqlite3_step` is actually needed, otherwise we'll always get the default values for all types.
This commit is contained in:
parent
2354b3e706
commit
81f5b89fe3
3 changed files with 8 additions and 1 deletions
|
@ -40,6 +40,7 @@ changes.
|
|||
- JSON RPC: `ping` now works even after one peer fails to respond.
|
||||
- JSON RPC: `getroute` `fuzzpercent` and `pay` `maxfeepercent` can now be > 100.
|
||||
- JSON RPC: `riskfactor` in `pay` and `getroute` no longer always treated as 1.
|
||||
- JSON-RPC: `listpeers` was always reporting 0 for all stats.
|
||||
- Protocol: fix occasional deadlock when both peers flood with gossip.
|
||||
- Protocol: fix occasional long delay on sending `reply_short_channel_ids_end`.
|
||||
- Protocol: re-send `node_announcement` when address/alias/color etc change.
|
||||
|
|
|
@ -976,7 +976,6 @@ def test_forward_pad_fees_and_cltv(node_factory, bitcoind):
|
|||
assert only_one(l3.rpc.listinvoices('test_forward_pad_fees_and_cltv')['invoices'])['status'] == 'paid'
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_forward_stats(node_factory):
|
||||
l1, l2, l3 = node_factory.line_graph(3, announce=True)
|
||||
|
||||
|
|
|
@ -798,6 +798,7 @@ void wallet_channel_stats_load(struct wallet *w,
|
|||
struct channel_stats *stats)
|
||||
{
|
||||
sqlite3_stmt *stmt;
|
||||
int res;
|
||||
stmt = db_prepare(w->db,
|
||||
"SELECT in_payments_offered, in_payments_fulfilled"
|
||||
" , in_msatoshi_offered, in_msatoshi_fulfilled"
|
||||
|
@ -806,6 +807,12 @@ void wallet_channel_stats_load(struct wallet *w,
|
|||
" FROM channels"
|
||||
" WHERE id = ?");
|
||||
sqlite3_bind_int64(stmt, 1, id);
|
||||
|
||||
res = sqlite3_step(stmt);
|
||||
|
||||
/* This must succeed, since we know the channel exists */
|
||||
assert(res == SQLITE_ROW);
|
||||
|
||||
stats->in_payments_offered = sqlite3_column_int64(stmt, 0);
|
||||
stats->in_payments_fulfilled = sqlite3_column_int64(stmt, 1);
|
||||
stats->in_msatoshi_offered = sqlite3_column_int64(stmt, 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue