Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_listsinceblock.py
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | def test_double_spend(self): | ||||
aa2 bb2 | aa2 bb2 | ||||
| | | | | | ||||
aa3 bb3 | aa3 bb3 | ||||
| | | | ||||
bb4 | bb4 | ||||
Problematic case: | Problematic case: | ||||
1. User 1 receives BCH in tx1 from utxo1 in block aa1. | 1. User 1 receives XEC in tx1 from utxo1 in block aa1. | ||||
2. User 2 receives BCH in tx2 from utxo1 (same) in block bb1 | 2. User 2 receives XEC in tx2 from utxo1 (same) in block bb1 | ||||
3. User 1 sees 2 confirmations at block aa3. | 3. User 1 sees 2 confirmations at block aa3. | ||||
4. Reorg into bb chain. | 4. Reorg into bb chain. | ||||
5. User 1 asks `listsinceblock aa3` and does not see that tx1 is now | 5. User 1 asks `listsinceblock aa3` and does not see that tx1 is now | ||||
invalidated. | invalidated. | ||||
Currently the solution to this is to detect that a reorg'd block is | Currently the solution to this is to detect that a reorg'd block is | ||||
asked for in listsinceblock, and to iterate back over existing blocks up | asked for in listsinceblock, and to iterate back over existing blocks up | ||||
until the fork point, and to include all transactions that relate to the | until the fork point, and to include all transactions that relate to the | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |