mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Avoid unecessary move of the previous block header to build a block.
This commit is contained in:
parent
2e52b13c35
commit
55f5771a2a
1 changed files with 2 additions and 2 deletions
|
@ -80,7 +80,7 @@ impl Writeable for BlockHeader {
|
||||||
// avoid complicating PoW
|
// avoid complicating PoW
|
||||||
try!(writer.write_u64(self.nonce));
|
try!(writer.write_u64(self.nonce));
|
||||||
// cuckoo cycle of 42 nodes
|
// cuckoo cycle of 42 nodes
|
||||||
for n in 0..42 {
|
for n in 0..PROOFSIZE {
|
||||||
try!(writer.write_u32(self.pow.0[n]));
|
try!(writer.write_u32(self.pow.0[n]));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -211,7 +211,7 @@ impl Block {
|
||||||
/// Builds a new block from the header of the previous block, a vector of
|
/// Builds a new block from the header of the previous block, a vector of
|
||||||
/// transactions and the private key that will receive the reward. Checks
|
/// transactions and the private key that will receive the reward. Checks
|
||||||
/// that all transactions are valid and calculates the Merkle tree.
|
/// that all transactions are valid and calculates the Merkle tree.
|
||||||
pub fn new(prev: BlockHeader,
|
pub fn new(prev: &BlockHeader,
|
||||||
txs: Vec<&mut Transaction>,
|
txs: Vec<&mut Transaction>,
|
||||||
reward_key: SecretKey)
|
reward_key: SecretKey)
|
||||||
-> Result<Block, secp::Error> {
|
-> Result<Block, secp::Error> {
|
||||||
|
|
Loading…
Reference in a new issue