Use waste metric for deciding which selection to use

Instead of always choosing BnB if it finds a solution, always do both
BnB and KnapsackSolver and choose the one which has the least waste.
This commit is contained in:
Andrew Chow
2021-05-20 19:52:18 -04:00
parent b3df0caf7c
commit 86beee0579
2 changed files with 31 additions and 4 deletions

View File

@ -543,7 +543,7 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes[1].getnewaddress()
self.nodes[1].getrawchangeaddress()
inputs = []
outputs = {self.nodes[0].getnewaddress():1.09999500}
outputs = {self.nodes[0].getnewaddress():1.19999500}
rawtx = self.nodes[1].createrawtransaction(inputs, outputs)
# fund a transaction that does not require a new key for the change output
self.nodes[1].fundrawtransaction(rawtx)