This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem:(CRO-524) Client may create transactions with potentially spe…
…nt utxos solution: - add a `pending_transaction` in wallet state, it's a BTreepMap of `txid` -> `pending_info` - the pending_info includes the `current block height` when the tx broadcast, the returned coin amount and the used `inputs` - after broadcast a transaction, we update the pending_info - when make a new transaction, we select the inputs which are in `unspent_transactions` and not in `pending_transactions` - we remove the `txid` from the `pending_transaction` when we find it in `sync` - we also remove the `txid` after `sync` finished if it can not be found in the latest `BLOCK_HEIGHT_ENSURE`(which is 50) blocks after it broadcast - change the wallet balance into 3 types: `total`, `pending`, `available`, we can only use the coins amount which is in `available` when we make a new transaction.
- Loading branch information
1 parent
06de599
commit 7ced010
Showing
16 changed files
with
499 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.