make sure we only set lock_height if >0

This commit is contained in:
antiochp
2019-08-19 14:29:16 +01:00
parent 6c322acaf8
commit 6b95593e7f
+4 -3
View File
@@ -286,9 +286,10 @@ where
let (mut parts, change_amounts_derivations) =
inputs_and_change(&coins, wallet, keychain_mask, amount, fee, change_outputs)?;
// This is more proof of concept than anything but here we set lock_height
// on tx being sent (based on current chain height via api).
parts.push(build::with_lock_height(lock_height));
// Build a "Plain" kernel unless lock_height>0 explicitly specified.
if lock_height > 0 {
parts.push(build::with_lock_height(lock_height));
}
Ok((parts, coins, change_amounts_derivations, fee))
}