Auto merge of #3561 - bitcartel:3560_update_sapling_note_data, r=bitcartel
Closes #3560. Update Sapling note data correctly when importing a key.
This commit is contained in:
commit
967bbbc486
|
@ -136,5 +136,13 @@ class WalletSaplingTest(BitcoinTestFramework):
|
||||||
assert('outCiphertext' in shieldedOutput)
|
assert('outCiphertext' in shieldedOutput)
|
||||||
assert('proof' in shieldedOutput)
|
assert('proof' in shieldedOutput)
|
||||||
|
|
||||||
|
# Verify importing a spending key will update the nullifiers and witnesses correctly
|
||||||
|
sk0 = self.nodes[0].z_exportkey(saplingAddr0)
|
||||||
|
self.nodes[2].z_importkey(sk0, "yes")
|
||||||
|
assert_equal(self.nodes[2].z_getbalance(saplingAddr0), Decimal('10'))
|
||||||
|
sk1 = self.nodes[1].z_exportkey(saplingAddr1)
|
||||||
|
self.nodes[2].z_importkey(sk1, "yes")
|
||||||
|
assert_equal(self.nodes[2].z_getbalance(saplingAddr1), Decimal('5'))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
WalletSaplingTest().main()
|
WalletSaplingTest().main()
|
||||||
|
|
|
@ -2379,7 +2379,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Increment note witness caches
|
// Increment note witness caches
|
||||||
IncrementNoteWitnesses(pindex, &block, sproutTree, saplingTree);
|
ChainTip(pindex, &block, sproutTree, saplingTree, true);
|
||||||
|
|
||||||
pindex = chainActive.Next(pindex);
|
pindex = chainActive.Next(pindex);
|
||||||
if (GetTime() >= nNow + 60) {
|
if (GetTime() >= nNow + 60) {
|
||||||
|
|
Loading…
Reference in New Issue