Removed this assertion as it was leading to a crash on my testnet4 #23
Reference in New Issue
Block a user
Delete Branch "refs/pull/23/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It's possible for an output amount to be 0 on a real blockchain -- a miner can mine a txn paying 0 to any address!
Such a thing happened on testnet4.
Here is the testnet4 txn in question that crashed the wallet at startup:
41a258f1abab61bd8c9819666081adca9c5e925a15a5f70b7d3da930a39c7c89(viewable here: https://tbch4.loping.net/tx/41a258f1abab61bd8c9819666081adca9c5e925a15a5f70b7d3da930a39c7c89).It pays to a wallet address an amount of "0".
The crash log for it before this change was:
I guess the code in question is trying to detect out-of-order tags appearing in the file or something so as to realize when
outputis not properly initialized.I wanted to define
0xffffffffffffffffullas the uninitialized output value -- but was unsure if this was safe to do in the code.This PR is just a suggestion -- perhaps you have a better way to do this, like using
std::optionalthere or something else like a special value that is not 0.I love asserts, you'll find a boatload all over the code. And indeed removing one or two that are not doing their job is Ok. No biggy. Its mostly useful for development on those features, but they are quite stable now.
So, yeah, I'll merge it as is. Thanks!
For the record, release builds do not have asserts compiled in.