mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-21 06:18:58 +08:00
added missing function
This commit is contained in:
@@ -32,6 +32,7 @@ use rand::RngCore;
|
||||
use rusqlite::Connection;
|
||||
use rusqlite::DatabaseName;
|
||||
use rusqlite::{Error as sqlite_error, OptionalExtension};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::burnchains::affirmation::AffirmationMap;
|
||||
use crate::burnchains::db::BurnchainDB;
|
||||
|
||||
@@ -217,7 +217,7 @@ use super::{BurnchainController, Config, EventDispatcher, Keychain};
|
||||
use crate::syncctl::PoxSyncWatchdogComms;
|
||||
use stacks::monitoring;
|
||||
|
||||
use stacks_common::types::chainstate::StacksBlockId;
|
||||
use stacks_common::types::chainstate::{StacksBlockId, StacksPrivateKey};
|
||||
use stacks_common::util::vrf::VRFProof;
|
||||
|
||||
use clarity::vm::ast::ASTRules;
|
||||
@@ -3821,6 +3821,25 @@ impl PeerThread {
|
||||
}
|
||||
|
||||
impl StacksNode {
|
||||
/// Create a StacksPrivateKey from a given seed buffer
|
||||
pub fn make_node_private_key_from_seed(seed: &[u8]) -> StacksPrivateKey {
|
||||
let node_privkey = {
|
||||
let mut re_hashed_seed = seed.to_vec();
|
||||
let my_private_key = loop {
|
||||
match Secp256k1PrivateKey::from_slice(&re_hashed_seed[..]) {
|
||||
Ok(sk) => break sk,
|
||||
Err(_) => {
|
||||
re_hashed_seed = Sha256Sum::from_data(&re_hashed_seed[..])
|
||||
.as_bytes()
|
||||
.to_vec()
|
||||
}
|
||||
}
|
||||
};
|
||||
my_private_key
|
||||
};
|
||||
node_privkey
|
||||
}
|
||||
|
||||
/// Set up the AST size-precheck height, if configured
|
||||
fn setup_ast_size_precheck(config: &Config, sortdb: &mut SortitionDB) {
|
||||
if let Some(ast_precheck_size_height) = config.burnchain.ast_precheck_size_height {
|
||||
|
||||
Reference in New Issue
Block a user