-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add for wind/unwind support to tbc (#159)
* Add function to determine canonical chain * Refactor tests to simplify calling code * Add name concept to block so that we can easily match blocks and geometry * Proper exit tests so that we can multiple fake nodes and tbc clients * Create odd geometries to hit corner cases * Detect direction * I think this fixes the unknown tip issue; code needs to be cleaned up but should go in for backup * Determine direction and call wind/unwind function * Flip direction logic around; while it was correct it was difficult to reason about * Add linear test * Add not linear error to check against * unindex transactions * cache parsed tx's in mined block for easy reference * Flesh out mustHave to check all cached tx's exist * ensure iterator does not step pout of bounds; it does :( * Fix silly reversals * Make this somewhat work * ugh go vet being dumb * Fixup names * Do not store coinbase in spent transaction cache * Bring back spent transaction cache test now that we no longer store the coinbase transaction * Collapse IsLinear function and add callers for the various indexers * Add utxo unwind * Attempt at utxo unwind * tbc: clean up unnecessary use of fmt.Errorf * XXX * maybe fix utxo unwind * try to spend some coinbase tx' * oops add new tx to mempool * rebase main fallout * Add a seperate tx signing test so that we can make this into a function that can be called from various spots in the code; this is too brittle to embed * Remove cruft * tbc: value of direction is never used (SA4006) * tbc: add missing err check in TestBlockHeaderEncodeDecode * tbc: replace loop with peers = append(peers, moreSeeds...) (S1011) * tbc: remove unused (*Server).blocksMissing function * tbcd/level: remove unused bytes2Block function * tbcd/level: remove unused bytes2Header function * tbcd/level: fix types being nested in one type block * Create generic transaction from another transaction lots of help max * Oops, print hex for scripthash * Add a non forking test * Working unwind!!! help from max and joshua * Make a note that genesis does not produce a spent output * mostly working forking unwind tests * Keep track of balances * disable broken balnce checks * Note a bug in unwinding utxos * Note an odd bug * wait for server to shut down * wait for port to be open * do not error if context is canceled * do not panic on cancel * tbc: handle err returned by btcutil.NewAddressPubKeyHash in test * tbc: use errors.New when formatting is not needed * tbc: improve some spacing, code flow and readability * tbc: attempt to improve impossible case for direction in TxIndexer * tbc: remove unnecessary space before : in errors * tbc: attempt to improve impossible case for direction in UtxoIndexer * large wtf * Fix off by one * remove wait groups, add listener.close, more timing for mine and send * add longer timing * The big Spend->Spent rename * Fix hemictl help * Bunch of cleanup * more fixes * Couple more fixes, lot's of help joshuasing * Update database/tbcd/database.go Co-authored-by: Joshua Sing <[email protected]> --------- Co-authored-by: Joshua Sing <[email protected]> Co-authored-by: ClaytonNorthey92 <[email protected]>
- Loading branch information
1 parent
5c764a0
commit f09d4e5
Showing
11 changed files
with
2,048 additions
and
817 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
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.