[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:
@@ -44,8 +44,8 @@ pub fn get_output(
|
||||
// For now we can just try both (but this probably needs to be part of the api
|
||||
// params)
|
||||
let outputs = [
|
||||
OutputIdentifier::new(OutputFeatures::DEFAULT_OUTPUT, &commit),
|
||||
OutputIdentifier::new(OutputFeatures::COINBASE_OUTPUT, &commit),
|
||||
OutputIdentifier::new(OutputFeatures::PLAIN, &commit),
|
||||
OutputIdentifier::new(OutputFeatures::COINBASE, &commit),
|
||||
];
|
||||
|
||||
for x in outputs.iter() {
|
||||
|
||||
+2
-9
@@ -251,10 +251,7 @@ impl OutputPrintable {
|
||||
block_header: Option<&core::BlockHeader>,
|
||||
include_proof: bool,
|
||||
) -> OutputPrintable {
|
||||
let output_type = if output
|
||||
.features
|
||||
.contains(core::transaction::OutputFeatures::COINBASE_OUTPUT)
|
||||
{
|
||||
let output_type = if output.is_coinbase() {
|
||||
OutputType::Coinbase
|
||||
} else {
|
||||
OutputType::Transaction
|
||||
@@ -278,11 +275,7 @@ impl OutputPrintable {
|
||||
// We require the rewind() to be stable even after the PMMR is pruned and
|
||||
// compacted so we can still recreate the necessary proof.
|
||||
let mut merkle_proof = None;
|
||||
if output
|
||||
.features
|
||||
.contains(core::transaction::OutputFeatures::COINBASE_OUTPUT)
|
||||
&& !spent && block_header.is_some()
|
||||
{
|
||||
if output.is_coinbase() && !spent && block_header.is_some() {
|
||||
merkle_proof = chain.get_merkle_proof(&out_id, &block_header.unwrap()).ok()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user