Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sv2/channels-sv2/src/server/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ where

let extranonce_prefix = job.get_extranonce_prefix();
let mut full_extranonce = vec![];
full_extranonce.extend(extranonce_prefix.clone());
full_extranonce.extend(share.extranonce.inner_as_ref());
full_extranonce.extend_from_slice(extranonce_prefix);
full_extranonce.extend_from_slice(share.extranonce.as_ref());

// calculate the merkle root from:
// - job coinbase_tx_prefix
Expand Down
6 changes: 6 additions & 0 deletions sv2/subprotocols/mining/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ pub struct Extranonce {
extranonce: alloc::vec::Vec<u8>,
}

impl AsRef<[u8]> for Extranonce {
fn as_ref(&self) -> &[u8] {
&self.extranonce
}
}

// this function converts a U256 type in little endian to Extranonce type
impl<'a> From<U256<'a>> for Extranonce {
fn from(v: U256<'a>) -> Self {
Expand Down
Loading