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.
701: Problem:(CRO-524) Client may create transactions with potentially spent utxos r=tomtau a=linfeng-crypto 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_transaction` - 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. Co-authored-by: linfeng <linfeng@crypto.com>
- Loading branch information
Showing
31 changed files
with
836 additions
and
219 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.