Skip to content

Commit

Permalink
assumeutxo: Add documentation on dumptxoutset serialization format
Browse files Browse the repository at this point in the history
  • Loading branch information
fjahr committed Mar 10, 2024
1 parent 08804c3 commit 8d67b35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rpc/blockchain.cpp
Expand Up @@ -2676,6 +2676,11 @@ UniValue CreateUTXOSnapshot(
unsigned int iter{0};
std::vector<std::pair<uint32_t, Coin>> coins;

// In the following code we collect all the coins (in the coins vector)
// that belong to a certain txid (key.hash) and when we have them all
// (key.hash != last_hash) we write them to file using the below lamda
// function.
// See also https://github.com/bitcoin/bitcoin/issues/25675
auto write_coins_to_file = [&](AutoFile& afile, const uint256& last_hash, const std::vector<std::pair<uint32_t, Coin>>& coins) {
afile << last_hash;
WriteCompactSize(afile, coins.size());
Expand Down

0 comments on commit 8d67b35

Please sign in to comment.