mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
bcli: Accept "already in chain" errors as success
This commit is contained in:
committed by
Rusty Russell
parent
39b71ef4a1
commit
910e79ddb5
@@ -16,6 +16,7 @@
|
|||||||
* This is how many request for each priority level we have.
|
* This is how many request for each priority level we have.
|
||||||
*/
|
*/
|
||||||
#define BITCOIND_MAX_PARALLEL 4
|
#define BITCOIND_MAX_PARALLEL 4
|
||||||
|
#define RPC_TRANSACTION_ALREADY_IN_CHAIN -27
|
||||||
|
|
||||||
enum bitcoind_prio {
|
enum bitcoind_prio {
|
||||||
BITCOIND_LOW_PRIO,
|
BITCOIND_LOW_PRIO,
|
||||||
@@ -489,7 +490,10 @@ static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcl
|
|||||||
bcli->output);
|
bcli->output);
|
||||||
|
|
||||||
response = jsonrpc_stream_success(bcli->cmd);
|
response = jsonrpc_stream_success(bcli->cmd);
|
||||||
json_add_bool(response, "success", *bcli->exitstatus == 0);
|
json_add_bool(response, "success",
|
||||||
|
*bcli->exitstatus == 0 ||
|
||||||
|
*bcli->exitstatus ==
|
||||||
|
RPC_TRANSACTION_ALREADY_IN_CHAIN);
|
||||||
json_add_string(response, "errmsg",
|
json_add_string(response, "errmsg",
|
||||||
*bcli->exitstatus ?
|
*bcli->exitstatus ?
|
||||||
tal_strndup(bcli->cmd,
|
tal_strndup(bcli->cmd,
|
||||||
|
|||||||
Reference in New Issue
Block a user