mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
test: simplify splitment with sendall
in wallet_basic
recipients receive equal share of the unspecified amount
This commit is contained in:
parent
923d24583d
commit
28ea4c7039
1 changed files with 2 additions and 8 deletions
|
@ -585,15 +585,9 @@ class WalletTest(BitcoinTestFramework):
|
|||
|
||||
# ==Check that wallet prefers to use coins that don't exceed mempool limits =====
|
||||
|
||||
# Get all non-zero utxos together
|
||||
# Get all non-zero utxos together and split into two chains
|
||||
chain_addrs = [self.nodes[0].getnewaddress(), self.nodes[0].getnewaddress()]
|
||||
singletxid = self.nodes[0].sendall(recipients=[chain_addrs[0]])['txid']
|
||||
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
|
||||
node0_balance = self.nodes[0].getbalance()
|
||||
# Split into two chains
|
||||
rawtx = self.nodes[0].createrawtransaction([{"txid": singletxid, "vout": 0}], {chain_addrs[0]: node0_balance / 2 - Decimal('0.01'), chain_addrs[1]: node0_balance / 2 - Decimal('0.01')})
|
||||
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx)
|
||||
singletxid = self.nodes[0].sendrawtransaction(hexstring=signedtx["hex"], maxfeerate=0)
|
||||
self.nodes[0].sendall(recipients=chain_addrs)
|
||||
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
|
||||
|
||||
# Make a long chain of unconfirmed payments without hitting mempool limit
|
||||
|
|
Loading…
Add table
Reference in a new issue