add lock_height to Transaction and TxKernel (#167)
* add lock_height to Transaction and TxKernel, sign msg including both fee and lock_height in kernel * make the order of the fields in tx and kernel more consistent * rename to kernel_sig_msg * add test to cover adding timelocked tx to pool, where tx is invalid based on current height of the blockchain * add tests for adding timelocked txs to blocks (valid and otherwise)
This commit is contained in:
committed by
Ignotus Peverell
parent
dc0dbc62be
commit
bf7c1fb44f
@@ -76,6 +76,7 @@ impl ApiEndpoint for OutputApi {
|
||||
let commit = Commitment::from_vec(c);
|
||||
|
||||
let out = self.chain.get_unspent(&commit).map_err(|_| Error::NotFound)?;
|
||||
|
||||
let header = self.chain
|
||||
.get_block_header_by_output_commit(&commit)
|
||||
.map_err(|_| Error::NotFound)?;
|
||||
|
||||
+2
-1
@@ -50,7 +50,7 @@ pub struct Output {
|
||||
pub proof: pedersen::RangeProof,
|
||||
/// The height of the block creating this output
|
||||
pub height: u64,
|
||||
/// The lock height (spendable after block)
|
||||
/// The lock height (earliest block this output can be spent)
|
||||
pub lock_height: u64,
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ impl Output {
|
||||
}
|
||||
_ => (OutputType::Transaction, 0),
|
||||
};
|
||||
|
||||
Output {
|
||||
output_type: output_type,
|
||||
commit: output.commit,
|
||||
|
||||
Reference in New Issue
Block a user