[wallet] Refactor ProcessImport()

Authored by John Newbery <john@johnnewbery.com> on Jan 11 2019, 21:32.


[wallet] Refactor ProcessImport()

This commit is move-only and doesn't make any functional changes. It
simply moves code around within ProcessImport() in preparation for
refactors in the next commits.

This is a partial backport of Core PR14491 : https://github.com/bitcoin/bitcoin/pull/14491/commits/a1b25e12a5f57048a4639964d57c0b46eb84cd4e

Some loop variable names have been changed to make sure we don't have shaddowing going on.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6141