mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
bitcoind: properly handle spent outputs in gettxout
exit status is not enough to detect spent outputs. gettxout will return a success exit code and 0 bytes. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Rusty Russell
parent
f27013c338
commit
3c0d2813a0
@@ -432,7 +432,9 @@ static void process_gettxout(struct bitcoin_cli *bcli)
|
||||
struct bitcoin_tx_output out;
|
||||
bool valid;
|
||||
|
||||
if (*bcli->exitstatus != 0) {
|
||||
/* As of at least v0.15.1.0, bitcoind returns "success" but an empty
|
||||
string on a spent gettxout */
|
||||
if (*bcli->exitstatus != 0 || bcli->output_bytes == 0) {
|
||||
log_debug(bcli->bitcoind->log, "%s: not unspent output?",
|
||||
bcli_args(bcli));
|
||||
tal_free(go);
|
||||
|
||||
Reference in New Issue
Block a user