Skip to content

Commit 910e79d

Browse files
cdeckerrustyrussell
authored andcommitted
bcli: Accept "already in chain" errors as success
1 parent 39b71ef commit 910e79d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/bcli.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* This is how many request for each priority level we have.
1717
*/
1818
#define BITCOIND_MAX_PARALLEL 4
19+
#define RPC_TRANSACTION_ALREADY_IN_CHAIN -27
1920

2021
enum bitcoind_prio {
2122
BITCOIND_LOW_PRIO,
@@ -489,7 +490,10 @@ static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcl
489490
bcli->output);
490491

491492
response = jsonrpc_stream_success(bcli->cmd);
492-
json_add_bool(response, "success", *bcli->exitstatus == 0);
493+
json_add_bool(response, "success",
494+
*bcli->exitstatus == 0 ||
495+
*bcli->exitstatus ==
496+
RPC_TRANSACTION_ALREADY_IN_CHAIN);
493497
json_add_string(response, "errmsg",
494498
*bcli->exitstatus ?
495499
tal_strndup(bcli->cmd,

0 commit comments

Comments
 (0)