Make AnalyzePSBT next role calculation simple, correct
Summary:
Set next to"finalizer" when all inputs need finalizing
Note that this assumes that PSBT roles are a complete ordering, which for now and in the future seems to be a correct assumption.
This is a backport of Core PR18224
Test Plan:
ninja && ninja check && test/functional/test_runner.py rpc_psbt
Check that before this patch to psbt.cpp the functional test fails because the "next" role is signer, and after this patch is has the correct "finalizer" value.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8778