From 58549503a35104e71af21142428eb5250af02d92 Mon Sep 17 00:00:00 2001 From: Sergey Markov Date: Sun, 8 May 2022 05:25:36 +0300 Subject: [PATCH] fix issue with missing coinbaseaux in JSON_RPC responce --- src/bitcoin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitcoin.c b/src/bitcoin.c index b114fd06..9fb25e4d 100644 --- a/src/bitcoin.c +++ b/src/bitcoin.c @@ -147,7 +147,12 @@ bool gen_gbtbase(connsock_t *cs, gbtbase_t *gbt) coinbase_aux = json_object_get(res_val, "coinbaseaux"); flags = json_string_value(json_object_get(coinbase_aux, "flags")); - if (unlikely(!previousblockhash || !target || !version || !curtime || !bits || !coinbase_aux || !flags)) { + if(!flags) { //bitcon core do not send coinbaseaux any more + flags = malloc(1*sizeof(char)); + memset(flags, 0, 1*sizeof(char)); + } + + if (unlikely(!previousblockhash || !target || !version || !curtime || !bits || !flags)) { LOGERR("JSON failed to decode GBT %s %s %d %d %s %s", previousblockhash, target, version, curtime, bits, flags); goto out; }