lightning 0.0.3

A Bitcoin Lightning implementation in Rust. Still super-early code-dump quality and is missing large chunks. See README in git repo for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to finish building it to even try.
Documentation
use bitcoin::blockdata::transaction::TxOut;

use std::cmp::Ordering;

pub fn sort_outputs<T>(outputs: &mut Vec<(TxOut, T)>) { //TODO: Make static and put it in some utils somewhere (+inputs sorting)
	outputs.sort_unstable_by(|a, b| {
		if a.0.value < b.0.value {
			Ordering::Less
		} else if b.0.value < a.0.value {
			Ordering::Greater
		} else if a.0.script_pubkey[..] < b.0.script_pubkey[..] { //TODO: ordering of scripts shouldn't be len-based
			Ordering::Less
		} else if b.0.script_pubkey[..] < a.0.script_pubkey[..] { //TODO: ordering of scripts shouldn't be len-based
			Ordering::Greater
		} else {
			Ordering::Equal
		}
	});
}