Skip to content

Pruned node support #84

@RCasatta

Description

@RCasatta
          Fwiw the following rather horrifying hack "works":
let bin_bh: [u8; 32] = hex::FromHex::from_hex("deadbeef...").unwrap();
let mut next = BlockHash::from_raw_hash(sha256d::Hash::from_byte_array(bin_bh));

(replacing the above linked definition of next ; of course you have to add the use statement: use bitcoin::hashes::{hex, sha256d, Hash};)

... where deabeef.. is the big-endian encoding of a block hash. But "works" with caveats:

  • the block hash used there should be that of the first block in your database, identifiable with bitcoin-cli getblockchaininfo (but I guess it changes over time, so you need to have bitcoind not running)
  • defining start_height and end_height doesn't work (at least, in my test), because I think with this hack it treats your first block as literally block 1 (or 0, whatever).

Still, it does output the data I wanted from a filter, so, it (barely) passes the bar of at least being worth reporting.

Originally posted by @AdamISZ in #83 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions