Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if the wallet has a large amount of SPKMans (e.g. after migrating a legacy wallet), we can avoid iterating through all of them by using the spk cache. The downside is we iterate through the tx inputs again when trying to sign with a particular SPK. If all our inputs are managed by the same SPK, then this is always faster due to the early exit. If not, its still faster when number of inputs < SPKMans in the wallet. It is slower in the case where number of inputs > SPKMans and all of the inputs are from different SPKs, which seems unlikely. This worst case could be improved by threading the input all the way through when signing, but that needs more thought.
- Loading branch information