From d4a34d546ad80f1d9fd4893e65835cfea421c35c Mon Sep 17 00:00:00 2001 From: evoskuil Date: Tue, 14 Apr 2026 16:13:13 -0400 Subject: [PATCH 1/2] Change default interval depth to 11. --- src/parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser.cpp b/src/parser.cpp index 996a9b3c..a322801d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -94,6 +94,9 @@ parser::parser(system::chain::selection context, // SCALE: LF2.2 @ 850K. + // Only used for electrum queries (255 is optimal otherwise). + configured.database.interval_depth = 11; + // database (archive) configured.database.header_buckets = 386'364; @@ -1391,7 +1394,7 @@ options_metadata parser::load_settings() THROWS ( "database.interval_depth", value(&configured.database.interval_depth), - "The interval depth for merkle proof optimization, defaults to '255' (disabled)." + "The interval depth for merkle proof optimization, defaults to '11'." ) /* header */ From 34e8d23270b49890cd5258ec9661dccf9a9723b8 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Wed, 15 Apr 2026 12:10:45 -0400 Subject: [PATCH 2/2] Complete electrum blockchain.outpoint.get.status. --- .../electrum/protocol_electrum_outputs.cpp | 39 +++++++------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/protocols/electrum/protocol_electrum_outputs.cpp b/src/protocols/electrum/protocol_electrum_outputs.cpp index 84078246..77c5b4d4 100644 --- a/src/protocols/electrum/protocol_electrum_outputs.cpp +++ b/src/protocols/electrum/protocol_electrum_outputs.cpp @@ -181,41 +181,30 @@ bool protocol_electrum::send_get_status(const std::string& tx_hash, } const auto& query = archive(); - const auto tx = query.to_tx(hash); - const auto output = query.to_output(tx, index); - if (output.is_terminal()) + const auto out = query.get_tx_history(hash); + if (!out.tx.is_valid()) { send_code(error::not_found); return false; } - // TODO: database query./////////////////////////////////////////////////// - size_t height{ database::history::rooted_height }; - if (const auto block = query.find_confirmed_block(tx); block.is_terminal()) - { - if (!query.is_confirmed_all_prevouts(tx)) - height = database::history::unrooted_height; - } - else if (!query.get_height(height, block)) + if (const auto ins = query.get_spenders_history(hash, index); ins.empty()) { - send_code(error::server_error); - return false; + send_result(object_t + { + { "height", to_unsigned(out.tx.height()) } + } , 64, BIND(complete, _1)); } - /////////////////////////////////////////////////////////////////////////// - - // TODO: query tx spenders sorted history.///////////////////////////////// - const database::histories spenders{}; - /////////////////////////////////////////////////////////////////////////// - - auto result = object_t{ { "height", to_unsigned(height) } }; - if (!spenders.empty()) + else { - const auto& spender = spenders.front().tx; - result["spender_txhash"] = encode_hash(spender.hash()); - result["spender_height"] = to_unsigned(spender.height()); + send_result(object_t + { + { "height", to_unsigned(out.tx.height()) }, + { "spender_txhash", encode_hash(ins.front().tx.hash()) }, + { "spender_height", to_unsigned(ins.front().tx.height()) } + }, 128, BIND(complete, _1)); } - send_result(std::move(result), 128, BIND(complete, _1)); return true; }