I wanted to open an issue to understand why `bnb_search` as [implemented](https://github.com/bitcoin/bitcoin/pull/10637) @achow101 does not terminate once an optimal search is found.  This behavior is evident I believe when inspecting the [test](https://github.com/bitcoin/bitcoin/blob/master/src/wallet/test/coinselector_tests.cpp#L178) which sets the target to `5` and uses the utxo pool `4,3,2,1`.  since combinations of `4` are evaluated first, the `bnb_search` finds an optimal solution of `4,1`.  However, instead of terminating when the `best_waste = 0` (no better solution can be found), the search continues and instead finds another solution `2,3` which also has a `best_waste = 0`.  Why not terminate once an optimal solution is found instead of continuing to search?
BOOST_CHECK_EQUAL(nValueRet, 1 * MIN_CHANGE); 
        
        add_coin(MIN_CHANGE * 6 / 10);
        add_coin(MIN_CHANGE * 7 / 10);
        
        BOOST_CHECK( testWallet.SelectCoinsMinConf(1 * MIN_CHANGE, filter_confirmed, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params, bnb_used));
        BOOST_CHECK_EQUAL(nValueRet, 1 * MIN_CHANGE); 
        
        
        empty_wallet();
        for (int j = 0; j < 20; j++)
            add_coin(50000 * COIN);
        BOOST_CHECK( testWallet.SelectCoinsMinConf(500000 * COIN, filter_confirmed, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params, bnb_used));
        BOOST_CHECK_EQUAL(nValueRet, 500000 * COIN); 
        BOOST_CHECK_EQUAL(setCoinsRet.size(), 10U); 
        
        
        
        empty_wallet();
        add_coin(MIN_CHANGE * 5 / 10);
        add_coin(MIN_CHANGE * 6 / 10);
        add_coin(MIN_CHANGE * 7 / 10);
        add_coin(1111 * MIN_CHANGE);
        BOOST_CHECK( testWallet.SelectCoinsMinConf(1 * MIN_CHANGE, filter_confirmed, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params, bnb_used));
        BOOST_CHECK_EQUAL(nValueRet, 1111 * MIN_CHANGE); 
        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);
        
        empty_wallet();
        add_coin(MIN_CHANGE * 4 / 10);
        add_coin(MIN_CHANGE * 6 / 10);