From d71a05919814c51aba584b43dcd86419aaba3c51 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 27 Jul 2023 00:29:33 +0000 Subject: [PATCH] Bugfix: RPC/Blockchain: Correct getblocklocations return type (array of objects, not array with named keys) --- src/rpc/blockchain.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index f1eba9722a..e8b9f496d4 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2883,10 +2883,13 @@ static RPCHelpMan getblocklocations() RPCResult{ RPCResult::Type::ARR, "", "", { - {RPCResult::Type::NUM, "file", "blk*.dat/rev*.dat file index"}, - {RPCResult::Type::NUM, "data", "block data file offset"}, - {RPCResult::Type::NUM, "undo", "undo data file offset (if exists)"}, - {RPCResult::Type::STR_HEX, "prev", "previous block hash"}, + {RPCResult::Type::OBJ, "", "", + { + {RPCResult::Type::NUM, "file", "blk*.dat/rev*.dat file index"}, + {RPCResult::Type::NUM, "data", "block data file offset"}, + {RPCResult::Type::NUM, "undo", /*optional=*/true, "undo data file offset (if exists)"}, + {RPCResult::Type::STR_HEX, "prev", "previous block hash"}, + }}, } }, },