wallet: Display addresses derived from scriptPubKey where available

In particular this matches the case of `their_unilateral/to_us` outputs, which
were missing their addresses so far.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-02-22 17:50:01 +01:00
committed by neil saitug
parent 478e2d7084
commit ed6a455a3c
3 changed files with 33 additions and 0 deletions

View File

@@ -1469,6 +1469,12 @@ def test_permfail(node_factory, bitcoind):
# generated some more blocks.
assert (closetxid, "confirmed") in set([(o['txid'], o['status']) for o in l1.rpc.listfunds()['outputs']])
# Check that the all the addresses match what we generated ourselves:
for o in l1.rpc.listfunds()['outputs']:
txout = bitcoind.rpc.gettxout(o['txid'], o['output'])
addr = txout['scriptPubKey']['addresses'][0]
assert(addr == o['address'])
addr = l1.bitcoin.rpc.getnewaddress()
l1.rpc.withdraw(addr, "all")