We introduced for secret keys the signature-type field, which is required
to avoid signing with one key as both Schnorr and ecdsa as
that can cause leakage making recovering the private key much easier.
So, we now store this data but old wallets didn't fetch that from
the incoming transactions. So this conversion fetches the data from the
transactions (which are on the device) and stores the sigtype with the
keys.
We wait until the chain is synched and then we check for and broadcast
unconfirmed transactions.
This essentially means that every single block we receive will trigger
this code. In BCH I think that is just fine since all we really do is
send an INV.
The code to re-org all transactions in a block so transactions that
depend on others are processed after those they depend on had a silly
bug (missing line), fixed that but also made it unit-testable to
demonstrate the bug.