This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CUtxoCommit BuildUtxoCommit(CCoinsViewCursor* pcursor, size_t numworkers) | |
{ | |
if (numworkers == 0) | |
throw std::invalid_argument("numworkers == 0"); | |
std::atomic<int> count(0); | |
std::mutex cs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simulation of Selfish mining with gamma=0 | |
# gamma=0 assumes a nearly full connected topology. | |
# We simulate a selfish pool p and h who mines honest | |
# As Gamma=0, we do not need to simulate more then two miners | |
# Tomas van der Wansem | |
import random; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyData { pub x: usize } | |
fn process<F>(mut callback: F) | |
where F : FnMut(MyData) { | |
for n in 0..10 { | |
let data = MyData { x: n }; | |
callback(data); |