@@ -246,25 +246,29 @@ def run_test(self):
246
246
tx2 = CTransaction ()
247
247
tx2 .vin = [CTxIn (COutPoint (int (unspent [1 ]["txid" ], 16 ), unspent [1 ]["vout" ]))]
248
248
amount = unspent [1 ]["amount" ] * 100000000
249
- tx2 .vout = [CTxOut (amount , scriptPubKey3 )]
249
+ tx2 .vout = [CTxOut (amount / 2 , scriptPubKey3 ), CTxOut ( amount / 2 , scriptPubKey3 )]
250
250
tx2 .rehash ()
251
251
signed_tx2 = self .nodes [2 ].signrawtransaction (binascii .hexlify (tx2 .serialize ()).decode ("utf-8" ))
252
252
memtxid2 = self .nodes [2 ].sendrawtransaction (signed_tx2 ["hex" ], True )
253
253
time .sleep (2 )
254
254
255
255
mempool = self .nodes [2 ].getaddressmempool ({"addresses" : [address3 ]})
256
- assert_equal (len (mempool ), 2 )
256
+ assert_equal (len (mempool ), 3 )
257
257
assert_equal (mempool [0 ]["txid" ], memtxid1 )
258
- assert_equal (mempool [1 ]["txid" ], memtxid2 )
259
258
assert_equal (mempool [0 ]["address" ], address3 )
259
+ assert_equal (mempool [0 ]["index" ], 0 )
260
+ assert_equal (mempool [1 ]["txid" ], memtxid2 )
261
+ assert_equal (mempool [1 ]["index" ], 0 )
262
+ assert_equal (mempool [2 ]["txid" ], memtxid2 )
263
+ assert_equal (mempool [2 ]["index" ], 1 )
260
264
261
265
self .nodes [2 ].generate (1 );
262
266
self .sync_all ();
263
267
mempool2 = self .nodes [2 ].getaddressmempool ({"addresses" : [address3 ]})
264
268
assert_equal (len (mempool2 ), 0 )
265
269
266
270
tx = CTransaction ()
267
- tx .vin = [CTxIn (COutPoint (int (memtxid2 , 16 ), 0 ))]
271
+ tx .vin = [CTxIn (COutPoint (int (memtxid2 , 16 ), 0 )), CTxIn ( COutPoint ( int ( memtxid2 , 16 ), 1 )) ]
268
272
tx .vout = [CTxOut (amount - 10000 , scriptPubKey2 )]
269
273
tx .rehash ()
270
274
self .nodes [2 ].importprivkey (privKey3 )
@@ -273,9 +277,11 @@ def run_test(self):
273
277
time .sleep (2 )
274
278
275
279
mempool3 = self .nodes [2 ].getaddressmempool ({"addresses" : [address3 ]})
276
- assert_equal (len (mempool3 ), 1 )
280
+ assert_equal (len (mempool3 ), 2 )
277
281
assert_equal (mempool3 [0 ]["prevtxid" ], memtxid2 )
278
282
assert_equal (mempool3 [0 ]["prevout" ], 0 )
283
+ assert_equal (mempool3 [1 ]["prevtxid" ], memtxid2 )
284
+ assert_equal (mempool3 [1 ]["prevout" ], 1 )
279
285
280
286
print "Passed\n "
281
287
0 commit comments