Don't scan outputs which are dust, track dust change as operating costs

Fixes #299.
This commit is contained in:
Luke Parker
2023-10-19 08:02:10 -04:00
parent d833254b84
commit 7b2dec63ce
8 changed files with 70 additions and 22 deletions

View File

@@ -132,6 +132,11 @@ impl<N: Network> Plan<N> {
res
}
pub fn expected_change(&self) -> u64 {
self.inputs.iter().map(|input| input.amount()).sum::<u64>() -
self.payments.iter().map(|payment| payment.amount).sum::<u64>()
}
pub fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
writer.write_all(self.key.to_bytes().as_ref())?;