mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-25 00:33:20 +08:00
open_reader_consensus_stubbed --> open_reader_consensus
This commit is contained in:
@@ -675,7 +675,7 @@ impl <'a> SortitionHandleConn <'a> {
|
||||
}
|
||||
|
||||
/// open a reader handle from a consensus hash
|
||||
pub fn open_reader_consensus_stubbed(connection: &'a SortitionDBConn<'a>, chain_tip: &ConsensusHash) -> Result<SortitionHandleConn<'a>, db_error> {
|
||||
pub fn open_reader_consensus(connection: &'a SortitionDBConn<'a>, chain_tip: &ConsensusHash) -> Result<SortitionHandleConn<'a>, db_error> {
|
||||
let sn = match SortitionDB::get_block_snapshot_consensus(&connection.conn, chain_tip)? {
|
||||
Some(sn) => sn,
|
||||
None => {
|
||||
|
||||
@@ -1089,7 +1089,7 @@ impl StacksChainState {
|
||||
}
|
||||
|
||||
pub fn get_parent_consensus_hash(sort_ic: &SortitionDBConn, parent_block_hash: &BlockHeaderHash, my_consensus_hash: &ConsensusHash) -> Result<Option<ConsensusHash>, Error> {
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus_stubbed(sort_ic, my_consensus_hash)?;
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus(sort_ic, my_consensus_hash)?;
|
||||
|
||||
// find all blocks that we have that could be this block's parent
|
||||
let sql = "SELECT * FROM snapshots WHERE winning_stacks_block_hash = ?1";
|
||||
@@ -1114,7 +1114,7 @@ impl StacksChainState {
|
||||
}
|
||||
};
|
||||
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus_stubbed(sort_ic, consensus_hash)?;
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus(sort_ic, consensus_hash)?;
|
||||
|
||||
// find all blocks that we have that could be this block's parent
|
||||
let sql = "SELECT * FROM snapshots WHERE winning_stacks_block_hash = ?1";
|
||||
@@ -2258,7 +2258,7 @@ impl StacksChainState {
|
||||
pub fn preprocess_anchored_block(&mut self, sort_ic: &SortitionDBConn, consensus_hash: &ConsensusHash, burn_header_timestamp: u64, block: &StacksBlock, parent_consensus_hash: &ConsensusHash) -> Result<bool, Error> {
|
||||
debug!("preprocess anchored block {}/{}", consensus_hash, block.block_hash());
|
||||
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus_stubbed(sort_ic, consensus_hash)?;
|
||||
let sort_handle = SortitionHandleConn::open_reader_consensus(sort_ic, consensus_hash)?;
|
||||
|
||||
// already in queue or already processed?
|
||||
let index_block_hash = StacksBlockHeader::make_index_block_hash(consensus_hash, &block.block_hash());
|
||||
|
||||
@@ -483,7 +483,7 @@ impl Relayer {
|
||||
};
|
||||
|
||||
// find the snapshot of the parent of this block
|
||||
let db_handle = SortitionHandleConn::open_reader_consensus_stubbed(sort_ic, consensus_hash)?;
|
||||
let db_handle = SortitionHandleConn::open_reader_consensus(sort_ic, consensus_hash)?;
|
||||
let parent_block_snapshot = match db_handle.get_block_snapshot_of_parent_stacks_block(consensus_hash, &block.block_hash())? {
|
||||
Some((_, sn)) => sn,
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user