Bugfix: RPC: blockchain: Actually include "temporary" flag in listprunelocks result

This commit is contained in:
Luke Dashjr 2023-12-20 21:58:08 +00:00
parent 427353a89d
commit 31874a0aee
2 changed files with 2 additions and 1 deletions

View File

@ -809,6 +809,7 @@ static RPCHelpMan listprunelocks()
heights_uv.push_back(lock_info.height_last);
}
prune_lock_uv.pushKV("height", heights_uv);
prune_lock_uv.pushKV("temporary", lock_info.temporary);
locks_uv.push_back(prune_lock_uv);
}
}

View File

@ -329,7 +329,7 @@ class PruneTest(BitcoinTestFramework):
"desc": "Testing",
"height": [2, 2],
})
assert_equal(node.listprunelocks(), {'prune_locks': [{'id': 'test', 'desc': 'Testing', 'height': [2, 2]}]})
assert_equal(node.listprunelocks(), {'prune_locks': [{'id': 'test', 'desc': 'Testing', 'height': [2, 2], 'temporary': False}]})
prune(500)
assert has_block(0), "blk00000.dat is missing when should still be there"
node.setprunelock("test", {}) # delete prune lock