Don't clean unconfirmed outputs > 500 blocks old (#2275)

* only clean unconfirmed coinbase

* only past 50 blocks
This commit is contained in:
Yeastplume 2019-01-02 14:27:17 +00:00 committed by GitHub
parent f5e4782a30
commit 906adb9e6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -309,12 +309,16 @@ where
C: NodeClient,
K: Keychain,
{
if height < 500 {
if height < 50 {
return Ok(());
}
let mut ids_to_del = vec![];
for out in wallet.iter() {
if out.status == OutputStatus::Unconfirmed && out.height > 0 && out.height < height - 500 {
if out.status == OutputStatus::Unconfirmed
&& out.height > 0
&& out.height < height - 50
&& out.is_coinbase
{
ids_to_del.push(out.key_id.clone())
}
}