Open PastaPastaPasta opened 10 months ago
I added a bunch of asserts into this to figure out what exactly is failing and it appears to me to be this that is actually failing https://github.com/dashpay/dash/blob/65ff12c303f1ca8303e608209fa101b066f6f508/src/wallet/walletdb.cpp#L134
Pretty sure this happens because all keys are encrypted in a single Transaction (and we do this because if something fails we don't end up with half keys encrypted on db and half keys still unencrypted or still not saved on db).
In this case there are too many keys in a single transaction, which gets too big and at some point we fail to write in the WalletBatch.
A solution would be doing multiple smaller transactions, but then a smart way to revert everything in case of failure should be implemented too
Steps to reproduce
Stack trace