Rpc: Manually add immature coinbase utxos

Before this commit, the rpc backend would not notice immature utxos
(`listunspent` does not return them), making the rpc balance different
to other blockchain implementations.

Co-authored-by: Daniela Brozzoni <danielabrozzoni@protonmail.com>
This commit is contained in:
志宇
2022-07-30 19:47:33 +08:00
parent ac19c19f21
commit 5eb74af414
2 changed files with 24 additions and 25 deletions

View File

@@ -1064,13 +1064,6 @@ macro_rules! bdk_blockchain_tests {
test_client.generate(1, Some(wallet_addr));
#[cfg(feature = "rpc")]
{
// rpc consider coinbase only when mature (100 blocks)
let node_addr = test_client.get_node_address(None);
test_client.generate(100, Some(node_addr));
}
wallet.sync(&blockchain, SyncOptions::default()).unwrap();
assert!(wallet.get_balance().unwrap() > 0, "incorrect balance after receiving coinbase");
}