We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd12639 commit d3a047eCopy full SHA for d3a047e
integration_test/tests/mining.rs
@@ -221,8 +221,12 @@ fn mining__submit_header() {
221
let best_block = node.client.get_best_block_hash().expect("getbestblockhash").into_model().unwrap().0;
222
let mut header = node.client.get_block_header(&best_block).expect("getblockheader").into_model().unwrap().0;
223
224
- // Change the nonce to ensure the header is different from the current tip.
225
- header.nonce = header.nonce.wrapping_add(1);
+ for _ in 1..=u32::MAX {
+ header.nonce = header.nonce.wrapping_add(1);
226
+ if header.validate_pow(header.target()).is_ok() {
227
+ break;
228
+ }
229
230
- let _ = node.client.submit_header(&header);
231
+ let _: () = node.client.submit_header(&header).expect("submitheader");
232
}
0 commit comments