generate_key_image_helper only appended to additional_recv_derivations when
generate_key_derivation succeeded. A tx pubkey that is not a valid point makes
that call fail, so every later derivation shifted down one slot.
is_out_to_acc_precomp indexes that vector by the output index, so once the
list is short the lookup either falls off the bounds check or reads the
derivation belonging to a different output. Either way the helper reports that
the output does not belong to the address, and the wallet cannot build a key
image for an output it owns. Anyone who can put a transaction in front of the
wallet chooses those pubkeys.
The main tx pubkey a few lines up already handles a failed derivation by
keeping its slot and padding with identity, and wallet2 does the same in the
three places it builds this list (wallet2.cpp:2393, :7887, :13397). Do it here
too.
The block 202612 PoW workaround previously applied to any block at
height 202612. Restrict it to the object hashes of the known historical
mainnet, testnet, and stagenet block hashing blobs so new chains do not
inherit the fixed PoW hash, which would prevent sync or mining past that
height if their difficulty is higher.
Reported-by: DataHoarder
Co-authored-by: jeffro256 <jeffro256@tutanota.com>