diff --git a/qa/rpc-tests/wallet_persistence.py b/qa/rpc-tests/wallet_persistence.py index f6c227d2a..581cad473 100755 --- a/qa/rpc-tests/wallet_persistence.py +++ b/qa/rpc-tests/wallet_persistence.py @@ -68,12 +68,22 @@ class WalletPersistenceTest (BitcoinTestFramework): # Verify shielded balance assert_equal(self.nodes[0].z_getbalance(sapling_addr), Decimal('20')) - + + # Verify size of shielded pools + pools = self.nodes[0].getblockchaininfo()['valuePools'] + assert_equal(pools[0]['chainValue'], Decimal('0')) # Sprout + assert_equal(pools[1]['chainValue'], Decimal('20')) # Sapling + # Restart the nodes stop_nodes(self.nodes) wait_bitcoinds() self.setup_network() + # Verify size of shielded pools + pools = self.nodes[0].getblockchaininfo()['valuePools'] + assert_equal(pools[0]['chainValue'], Decimal('0')) # Sprout + assert_equal(pools[1]['chainValue'], Decimal('20')) # Sapling + # Node 0 sends some shielded funds to Node 1 dest_addr = self.nodes[1].z_getnewaddress('sapling') recipients = [] @@ -128,4 +138,4 @@ class WalletPersistenceTest (BitcoinTestFramework): assert_equal(self.nodes[1].z_getbalance(dest_addr), Decimal('16')) if __name__ == '__main__': - WalletPersistenceTest().main() \ No newline at end of file + WalletPersistenceTest().main() diff --git a/src/txdb.cpp b/src/txdb.cpp index 212eda7a0..63e00dcd8 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -670,7 +670,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nCachedBranchId = diskindex.nCachedBranchId; pindexNew->nTx = diskindex.nTx; pindexNew->nSproutValue = diskindex.nSproutValue; - + pindexNew->nSaplingValue = diskindex.nSaplingValue; + // Consistency checks auto header = pindexNew->GetBlockHeader(); if (header.GetHash() != pindexNew->GetBlockHash())