Merge pull request #838 from TheBlueMatt/2021-03-skip-blocks
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index 7c5875ac1ef62d31590241228027fd75b954aba2..87b95cf2a538a972e882a2d2ad0ca6fb2bd99c47 100644 (file)
@@ -234,7 +234,7 @@ fn check_api_err(api_err: APIError) {
                                _ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
                                _ if err.starts_with("Cannot send value that would overdraw remaining funds.") => {},
                                _ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => {},
-                               _ => panic!(err),
+                               _ => panic!("{}", err),
                        }
                },
                APIError::MonitorUpdateFailed => {
@@ -435,11 +435,11 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                        let chain_hash = genesis_block(Network::Bitcoin).block_hash();
                        let mut header = BlockHeader { version: 0x20000000, prev_blockhash: chain_hash, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
                        let txdata: Vec<_> = channel_txn.iter().enumerate().map(|(i, tx)| (i + 1, tx)).collect();
-                       $node.block_connected(&header, &txdata, 1);
-                       for i in 2..100 {
+                       $node.transactions_confirmed(&header, 1, &txdata);
+                       for _ in 2..100 {
                                header = BlockHeader { version: 0x20000000, prev_blockhash: header.block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
-                               $node.block_connected(&header, &[], i);
                        }
+                       $node.update_best_block(&header, 99);
                } }
        }