mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
bitcoind: Do not copy the newline character when asking for a block
In the short_channel_id check we were copying the entire result into the next bitcoin-cli call, including the newline character. Signed-off-by: Christian Decker <decker.christian@gmail.com> Reported-By: @gdassori
This commit is contained in:
parent
ba3ceb2abf
commit
0ba687732f
@ -604,6 +604,7 @@ static bool process_getblockhash_for_txout(struct bitcoin_cli *bcli)
|
||||
const struct bitcoin_tx_output *output,
|
||||
void *arg) = bcli->cb;
|
||||
struct get_output *go = bcli->cb_arg;
|
||||
char *blockhash;
|
||||
|
||||
if (*bcli->exitstatus != 0) {
|
||||
void *cbarg = go->cbarg;
|
||||
@ -614,10 +615,11 @@ static bool process_getblockhash_for_txout(struct bitcoin_cli *bcli)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Strip the newline at the end of the previous output */
|
||||
blockhash = tal_strndup(NULL, bcli->output, bcli->output_bytes-1);
|
||||
|
||||
start_bitcoin_cli(bcli->bitcoind, NULL, process_getblock, false, cb, go,
|
||||
"getblock",
|
||||
take(tal_strndup(NULL, bcli->output,bcli->output_bytes)),
|
||||
NULL);
|
||||
"getblock", take(blockhash), NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user