Skip to content

Commit 84e5d3e

Browse files
committed
Comments.
1 parent 3025228 commit 84e5d3e

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/protocols/electrum/protocol_electrum.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ void protocol_electrum::do_outpoint(node::address_t) NOEXCEPT
241241
{
242242
chain::point point{};
243243

244-
// TODO: compute and return outpont status from a store query.
244+
// TODO: compute and return outpoint status from a store query.
245+
// TODO: unlike scripthash, this is not a cumulative "status" hash.
245246
send_notification("blockchain.outpoint.subscribe", array_t
246247
{
247248
array_t{ encode_hash(point.hash()), point.index() },
@@ -270,7 +271,7 @@ void protocol_electrum::do_address(node::address_t ) NOEXCEPT
270271
midstate value{};
271272
auto copy = value;
272273

273-
// EXAMPLE
274+
// EXAMPLE:
274275
// script_hash is a payment address for address.
275276
send_notification("blockchain.address.subscribe", array_t
276277
{
@@ -285,7 +286,7 @@ void protocol_electrum::do_scripthash(node::address_t) NOEXCEPT
285286
std::string status_hash{};
286287
std::string script_hash{};
287288

288-
// EXAMPLE
289+
// EXAMPLE:
289290
// script_hash is a payment address for address.
290291
send_notification("blockchain.scripthash.subscribe", array_t
291292
{
@@ -300,7 +301,7 @@ void protocol_electrum::do_scriptpubkey(node::address_t) NOEXCEPT
300301
std::string status_hash{};
301302
std::string script_hash{};
302303

303-
// EXAMPLE
304+
// EXAMPLE:
304305
// script_hash is a payment address for address.
305306
send_notification("blockchain.scriptpubkey.subscribe", array_t
306307
{

src/protocols/electrum/protocol_electrum_scripthash.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,14 @@ array_t protocol_electrum::transform(const database::histories& ins) NOEXCEPT
393393
};
394394

395395
if (unconfirmed)
396+
{
397+
// A fee of max_uint64 implies missing prevout(s). This will happen
398+
// for a block-downloaded tx queried during parallel block download
399+
// when the prevout block(s) are not yet archived or even if the tx
400+
// turned out to be in an invalid block after its block download. A
401+
// transaction is technically never invalid absent a block context.
396402
object["fee"] = in.fee;
403+
}
397404

398405
return object;
399406
});

0 commit comments

Comments
 (0)