mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-27 01:11:59 +02:00
Merge bitcoin/bitcoin#31925: contrib: update utxo_to_sqlite
tool documentation and comment
e747ed989ebb7b9650ba1478d583f7f507e1083f contrib: fix read metadata related comment (rkrux) d3095ac35a8891afc891458211130170d5a8a12e contrib: update `dumptxoutset` command in utxo_to_sqlite doc (rkrux) Pull request description: I noticed couple discrepancies in the documentation and comments of `utxo_to_sqlite` tool while using it, this PR fixes them. More details in the commit messages. ACKs for top commit: theStack: lgtm ACK e747ed989ebb7b9650ba1478d583f7f507e1083f Tree-SHA512: c5dab25d97c50a203ba008acfc5c93baf20cf24261a5a5127bdacc41eeeeae1c9d7b129710c2997e9fd1536ec000186e7f6395efc0188e1111b47868b7d9745a
This commit is contained in:
commit
279ab20bbd
@ -5,7 +5,7 @@
|
||||
"""Tool to convert a compact-serialized UTXO set to a SQLite3 database.
|
||||
|
||||
The input UTXO set can be generated by Bitcoin Core with the `dumptxoutset` RPC:
|
||||
$ bitcoin-cli dumptxoutset ~/utxos.dat
|
||||
$ bitcoin-cli dumptxoutset ~/utxos.dat latest
|
||||
|
||||
The created database contains a table `utxos` with the following schema:
|
||||
(txid TEXT, vout INT, value INT, coinbase INT, height INT, scriptpubkey TEXT)
|
||||
@ -126,7 +126,7 @@ def main():
|
||||
con = sqlite3.connect(args.outfile)
|
||||
con.execute("CREATE TABLE utxos(txid TEXT, vout INT, value INT, coinbase INT, height INT, scriptpubkey TEXT)")
|
||||
|
||||
# read metadata (magic bytes, version, network magic, block height, block hash, UTXO count)
|
||||
# read metadata (magic bytes, version, network magic, block hash, UTXO count)
|
||||
f = open(args.infile, 'rb')
|
||||
magic_bytes = f.read(5)
|
||||
version = int.from_bytes(f.read(2), 'little')
|
||||
|
Loading…
x
Reference in New Issue
Block a user