mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
wallet: track our change outputs
Add change scripts to our txfilter so that we mark them as confirmed (and can subsequently spend them)
This commit is contained in:
parent
01e0ba8232
commit
10ed2ebdb4
@ -8,7 +8,6 @@ import pytest
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_withdraw(node_factory, bitcoind):
|
||||
amount = 1000000
|
||||
# Don't get any funds from previous runs.
|
||||
|
@ -1372,6 +1372,11 @@ int wallet_extract_owned_outputs(struct wallet *w, const struct bitcoin_tx *tx,
|
||||
tal_free(utxo);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* This is an unconfirmed change output, we should track it */
|
||||
if (!is_p2sh && !blockheight)
|
||||
txfilter_add_scriptpubkey(w->ld->owned_txfilter, script);
|
||||
|
||||
outpointfilter_add(w->owned_outpoints, &utxo->txid, utxo->outnum);
|
||||
|
||||
if (!amount_sat_add(total, *total, utxo->amount))
|
||||
|
Loading…
Reference in New Issue
Block a user