Class: BSV::Transaction::ChainTracker
- Inherits:
-
Object
- Object
- BSV::Transaction::ChainTracker
- Defined in:
- lib/bsv/transaction/chain_tracker.rb
Overview
Base class for chain trackers that verify merkle roots against the blockchain.
Chain trackers confirm that a given merkle root corresponds to a valid block at a specific height. This is essential for SPV verification — without it, merkle proofs cannot be validated against the actual blockchain.
Subclasses must implement #valid_root_for_height? and #current_height.
Direct Known Subclasses
BSV::Transaction::ChainTrackers::Chaintracks, BSV::Transaction::ChainTrackers::WhatsOnChain
Instance Method Summary collapse
-
#current_height ⇒ Integer
Return the current blockchain height.
-
#valid_root_for_height?(_root, _height) ⇒ Boolean
Verify that a merkle root is valid for the given block height.
Instance Method Details
#current_height ⇒ Integer
Return the current blockchain height.
38 39 40 |
# File 'lib/bsv/transaction/chain_tracker.rb', line 38 def current_height raise NotImplementedError, "#{self.class}#current_height must be implemented" end |
#valid_root_for_height?(_root, _height) ⇒ Boolean
Verify that a merkle root is valid for the given block height.
30 31 32 |
# File 'lib/bsv/transaction/chain_tracker.rb', line 30 def valid_root_for_height?(_root, _height) raise NotImplementedError, "#{self.class}#valid_root_for_height? must be implemented" end |