fix(btc): correct prev output in optimistic update (#807)
fix(btc): correct prev output in optimistic update (#807)

* fix(btc): correct prev output in optimistic update

As we merge foreign outputs in BTC-like currencies, we cannot directly
access the "previous transaction" output with the index. It is necessary
to scan every output and find it with a matching predicate

Fixes VSD-678

* refactor(btc): optimistic update steps as fns
LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core