mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
test: Verify findCommonAncestor always initializes outputs
Also add code comment to clarify surprising code noted by practicalswift https://github.com/bitcoin/bitcoin/pull/18657#issuecomment-614278450
This commit is contained in:
parent
4bd6bc5cb4
commit
9986608ba9
2 changed files with 8 additions and 0 deletions
|
|
@ -116,6 +116,12 @@ BOOST_AUTO_TEST_CASE(findCommonAncestor)
|
|||
BOOST_CHECK_EQUAL(orig_height, orig_tip->nHeight);
|
||||
BOOST_CHECK_EQUAL(fork_height, orig_tip->nHeight - 10);
|
||||
BOOST_CHECK_EQUAL(fork_hash, active[fork_height]->GetBlockHash());
|
||||
|
||||
uint256 active_hash, orig_hash;
|
||||
BOOST_CHECK(!chain->findCommonAncestor(active.Tip()->GetBlockHash(), {}, {}, FoundBlock().hash(active_hash), {}));
|
||||
BOOST_CHECK(!chain->findCommonAncestor({}, orig_tip->GetBlockHash(), {}, {}, FoundBlock().hash(orig_hash)));
|
||||
BOOST_CHECK_EQUAL(active_hash, active.Tip()->GetBlockHash());
|
||||
BOOST_CHECK_EQUAL(orig_hash, orig_tip->GetBlockHash());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(hasBlocks)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue