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:
志宇andDaniela Brozzoni committed 2022-08-04 11:27:50 +08:00
1 parent ac19c19f21
commit 5eb74af414
2 files changed
+24 -25

No files matched your search

-7
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");
}