use rand::{thread_rng,Rng};
use std::cell::RefCell;
-use std::collections::HashMap;
-use std::default::Default;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use std::mem;
macro_rules! check_spends {
($tx: expr, $spends_tx: expr) => {
{
- let mut funding_tx_map = HashMap::new();
- let spends_tx = $spends_tx;
- funding_tx_map.insert(spends_tx.txid(), spends_tx);
- $tx.verify(&funding_tx_map).unwrap();
+ $tx.verify(|out_point| {
+ if out_point.txid == $spends_tx.txid() {
+ $spends_tx.output.get(out_point.vout as usize).cloned()
+ } else {
+ None
+ }
+ }).unwrap();
}
}
}
let err = origin_node.node.send_payment(route, our_payment_hash).err().unwrap();
match err {
- APIError::ChannelUnavailable{err} => assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight"),
+ APIError::ChannelUnavailable{err} => assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight our peer will accept"),
_ => panic!("Unknown error variants"),
};
}