[Floonet] add feature for height locked kernels (#2168)

* add feature for height locked kernels

* add function to compute kernel features appropriate for lock height, and use it

* only sign kernel-features relevant fields; refactor Features

* simplify invalid kernel logic

* remove unused height arg to reward::output and run some rustfmt

* replace nested if/else by match
This commit is contained in:
John Tromp
2018-12-18 19:26:34 +01:00
committed by Yeastplume
parent aa9da6838b
commit f43df5f601
26 changed files with 175 additions and 124 deletions
+2 -2
View File
@@ -16,7 +16,7 @@
use crate::core::core::hash::Hash;
use crate::core::core::pmmr::{self, ReadonlyPMMR};
use crate::core::core::{Block, BlockHeader, Input, Output, OutputFeatures, Transaction};
use crate::core::core::{Block, BlockHeader, Input, Output, Transaction};
use crate::core::global;
use crate::core::ser::PMMRIndexHashable;
use crate::error::{Error, ErrorKind};
@@ -105,7 +105,7 @@ impl<'a> UTXOView<'a> {
// outputs we are attempting to spend.
let pos = inputs
.iter()
.filter(|x| x.features.contains(OutputFeatures::COINBASE_OUTPUT))
.filter(|x| x.is_coinbase())
.filter_map(|x| self.batch.get_output_pos(&x.commitment()).ok())
.max()
.unwrap_or(0);