json-rpc: Include received and resolved time to listforward result

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-04-03 21:28:33 +02:00
committed by Rusty Russell
parent 75de2e2f3c
commit 27afc804d5
7 changed files with 38 additions and 3 deletions

View File

@@ -1052,7 +1052,7 @@ def test_forward_stats(node_factory, bitcoind):
We wire up the network to have l1 as payment initiator, l2 as
forwarded (the one we check) and l3-l5 as payment recipients. l3
accepts correctly, l4 refects (because it doesn't know the payment
accepts correctly, l4 rejects (because it doesn't know the payment
hash) and l5 will keep the HTLC dangling by disconnecting.
"""
@@ -1119,6 +1119,9 @@ def test_forward_stats(node_factory, bitcoind):
assert l2.rpc.getinfo()['msatoshi_fees_collected'] == 1 + amount // 100000
assert l1.rpc.getinfo()['msatoshi_fees_collected'] == 0
assert l3.rpc.getinfo()['msatoshi_fees_collected'] == 0
assert stats['forwards'][0]['received_time'] <= stats['forwards'][0]['resolved_time']
assert stats['forwards'][1]['received_time'] <= stats['forwards'][1]['resolved_time']
assert 'received_time' in stats['forwards'][2] and 'resolved_time' not in stats['forwards'][2]
@unittest.skipIf(not DEVELOPER or SLOW_MACHINE, "needs DEVELOPER=1 for dev_ignore_htlcs, and temporarily disabled on Travis")