* [NOD-289] Implemented database isCurrent checking and connection.
* [NOD-289] Added GetChainFromBlock to RPCClient.
* [NOD-289] Limited the amount of blocks in GetChainFromBlockResponse.
* [NOD-289] Fixed various issues that were keeping GetChainFromBlocks from working properly.
* [NOD-289] Created blockloop.go.
* [NOD-289] Updated go.mod after merge.
* [NOD-289] Implemented collection of current selected parent chain.
* [NOD-289] Fixed test. Reverted not deleting utxoDiffData from the DB.
* [NOD-289] Implemented GetBlocks.
* [NOD-289] Added comment to BlockHashesFrom.
* [NOD-289] Added GetBlocks to rpcclient.
* [NOD-289] Added verboseBlocks to GetBlocks.
* [NOD-289] Implemented block insertion.
* [NOD-289] Added AUTO_INCREMENT to tables that were missing it.
* [NOD-289] Made gasLimit in subnetwork nullable.
* [NOD-289] Renamed transactions_outputs to transaction_outputs.
* [NOD-289] Fixed weird coinbase behavior in vin.
* [NOD-289] Made collectCurrentBlocks start from the most recent startHash.
* [NOD-289] Added IsChainBlock to GetBlockVerboseResult.
* [NOD-289] Implemented adding a block from onBlockAdded.
* [NOD-289] Added removedParentChainHashes to getChainFromBlock.
* [NOD-289] Implemented updating the selected parent chain from onChainChanged.
* [NOD-289] Implemented some initial logic for updating the UTXO.
* [NOD-289] Fixed merge errors.
* [NOD-326] Fixed some more merge errors.
* [NOD-289] Added error handling for missing required records.
* [NOD-289] Implemented handling removedChainHashes.
* [NOD-289] Implemented handling addedChainBlocks.
* [NOD-289] Fixed incorrect coinbase check.
* [NOD-289] Implemented inserting the transaction output address.
* [NOD-289] Added updating block.IsChainBlock.
* [NOD-289] Split insertBlock into many small functions.
* [NOD-289] Split updateSelectedParentChain into smaller functions.
* [NOD-289] Fixed pointer errors.
* [NOD-289] Fixed a bad exists check.
* [NOD-289] Fixed a couple of small bugs.
* [NOD-289] Fixed a TxID/Hash mixup.
* [NOD-289] Added block/tx mass to getBlockVerboseResponse.
* [NOD-289] Renamed blockLoop.go to sync.go. Added comments.
* [NOD-289] Deleted apiserver README.
* [NOD-289] Fixed golint errors.
* [NOD-289] Renamed findMostRecentBlockHash to findHashOfBluestBlock.
* [NOD-289] Fixed style in syncBlocks and fixed a comment.
* [NOD-289] Copied NewErrorFromDBErrors over from NOD-324.
* [NOD-289] Created a couple of utils to make error handling with gorm slightly less painful.
* [NOD-289] Added error handling for database calls.
* [NOD-289] Fixed some more style/comments.
* [NOD-289] Fixed comments.
* [NOD-289] Renamed TransactionInput.TransactionOutput to TransactionInput.PreviousTransactionOutput.
* [NOD-289] Added a commends about pagination in getBlocks and getChainFromBlock.
* [NOD-289] Removed the coinbase field from Vin.
* [NOD-289] Deferred handling chainChangedMsgs until we have the appropriate data.
* [NOD-289] Optimized queries in updateRemovedChainHashes and updateAddedChainBlocks.
* [NOD-289] Optimized queries in insertBlockParents.
* [NOD-289] Optimized queries in insertTransactionInput.
* [NOD-289] Split Where calls to separate lines.
* [NOD-289] Fixed merge errors.
* [NOD-289] Exited early from insertBlockParents if we're the genesis block.
* [NOD-289] Improved nextChainChangedChan mechanism.
* [NOD-289] Fixed the above sync mechanism a bit.
* [NOD-289] Renamed IsDBRecordNotFoundError to HasDBRecordNotFoundError and IsDBError to HasDBError.
* [NOD-289] Replaced old error handling for db errors with the lovely new stuff.
* [NOD-289] Exited early if we already inserted a block. This saves us checking if a record already exists for some record types.
* [NOD-289] Decoupled syncBlocks from syncSelectedParentChain.
* [NOD-289] Made a comment more explicit.
* [NOD-289] Extracted net resolution to a separate function.
* [NOD-289] Extracted syncing to a separate function.
* [NOD-289] Fixed a comment.
* [NOD-289] Fixed merge erros.
* [NOD-289] Fixed a couple of bugs.
* [NOD-289] Fixed another bug.
* [NOD-289] Extracted ChainChangedMsg conversion to a separate function.
* [NOD-289] Optimized queries in canHandleChainChangedMsg.
* [NOD-289] Moved the sync function closer to its call site.
* [NOD-289] Renamed HasDBRecordNotFoundError to IsDBRecordNotFoundError.
* [NOD-289] Used count instead of first.
* [NOD-289] Renamed address to hexAddress.
* [NOD-297] Fix onChainChanged on rpcclient
* [NOD-285] create gorm models for db (#378)
* [NOD-285] Map API-Server database using GORM
* [NOD-285] Add accepting block to transactions and blocks models, and remove accepting block model
* [NOD-285] Define model relations
* [NOD-285] Fix many to many for Transaction and Block models
* [NOD-285] Remove redundant main file
* [NOD-296] Send SyncMgr.SubmitBlock errors as rpc errors (#381)
* [NOD-296] Send SyncMgr.SubmitBlock errors as rpc errors
* [NOD-296] Add error message prefix
* [NOD-298] Add comments to gorm models (#382)
* [NOD-294] Fix golint in deploy.sh and fix all lint warnings (#380)
* [NOD-294] Fix golint in deploy.sh and fixed all lint errors
* [NOD-294] Fix typos in comments
* [NOD-294] Convert VirtualForTest into alias of *virtualBlock
* [NOD-294] Fixed some more typos in comments
* [NOD-295] Limit the length of GetData to 50 (#383)
* [NOD-295] Fixed bad break condition in addInvsToGetDataMessageFromQueue.
* [NOD-295] Fixed the fix for bad break condition in addInvsToGetDataMessageFromQueue.
* [NOD-295] Made the check for max invs refer to invsNum instead of MaxInvPerGetDataMsg.
* [NOD-297] Fix onChainChanged on rpcclient
* [NOD-286] Implement API-Server base structure (#379)
* [NOD-286] Implement API-Server base structure
* [NOD-286] Add rpc user and password as command line arguments
* [NOD-286] Make log directory a CLI argument
* [NOD-286] Add db login details as CLI arguments
* [NOD-297] Fix onChainChanged on rpcclient and server
* [NOD-297] Fix variables and functions names
* [NOD-297] Fix AcceptedTxIds -> AcceptedTxIDs
* [NOD-294] Fix golint in deploy.sh and fixed all lint errors
* [NOD-294] Fix typos in comments
* [NOD-294] Convert VirtualForTest into alias of *virtualBlock
* [NOD-294] Fixed some more typos in comments
* [NOD-270] Added notifyChainChanges and related commands.
* [NOD-270] Added NTChainChanged to blockdag.
* [NOD-270] Implemented collection and sending of ChainChanged notifications.
* [NOD-270] Fixed an improperly named test.
* [NOD-270] Added a test: TestChainChangedNotification.
* [NOD-270] Fixed a couple copy+paste errors.
* [NOD-270] Added a couple of comments for TestChainChangedNotification.
* [NOD-270] Fixed formatting error.
* [NOD-270] Fixed a comment.
* [NOD-270] Uncoupled chain updates inside blockdag from the concept of a notification.
* [NOD-270] Removed intermediary ChainUpdates object from ChainChangedNotificationData.
* [NOD-256] Add error log
* [NOD-256] Add error log
* [NOD-256] Fix typo and comment
* [NOD-256] Remove btclog dir
* [NOD-256] Format project
* [NOD-256] Add error log files
* [NOD-256] Add an option to add a log file to write into to an existing backend logger
* [NOD-256] Get rid of redundant logs initialization
* [NOD-256] rename initLogRotators to initLog
* [NOD-256] Get rid ExampleSignTxOutput and convert ExampleBlockDAG_ProcessBlock to a regular test
* [NOD-256] Show error message if os.Exiting from initLog
* [NOD-241] Implement lower resolution peer rendezvous point discovery
* [NOD-241] Implement lower resolution peer rendezvous point discovery
* [NOD-241] Find exact rendezvous point
* [NOD-241] Find exact rendezvous point
* [NOD-241] Fix tests
* [NOD-241] Remove hash stop from MsgBlockLocator and add tests to MsgBlockLocator and MsgGetBlockLocator
* [NOD-241] Change everywhere startHash to hashStart and change comments
* [NOD-241] Fix locateBlockNodes to stop at hashStop
* [NOD-241] Formatted locatorSummary.
* [NOD-241] Fix node reversal
* [NOD-241] Fix hash start and hash stop order, and don't include startNode in dag.blockLocator
* [NOD-241] rename locateBlockNodes -> getBlueBlocksBetween and add a comment to it
* [NOD-241] change hash start to start hash and hash stop to stop hash
* [NOD-241] Move block locator stuff to a different file
* [NOD-241] Rename msggetblocks.go to msggetblockinvs.go
* [NOD-241] Format project
* [NOD-241] Rename rpcserverSyncManager.LocateHeaders to GetBlueBlocksHeadersBetween
* [NOD-241] Move the logic of finding the highest shared block to OnBlockLocator
* [NOD-241] Rename chainHeight -> nextChainHeight
* [NOD-241] Fix typo in comment
* [NOD-240] Removed references to the wallet in rpcserver.go.
* [NOD-240] Began removing btcwalletxxx.go.
* [NOD-240] Got rid of rpcclient/wallet.go and walletsvrcmds.go.
* [NOD-240] Moved GetBestBlockResult to dagsvrresults.go.
* [NOD-240] Finished removing walletsvrXXX.go.
* [NOD-240] Removed wallet stuff from btcctl.
* [NOD-240] Removed a few last things that I've missed.
* [NOD-208] Added blockBlueScore to UTXOEntry.
* [NOD-208] Added blueBlockScore to NewUTXOEntry.
* [NOD-208] Fixed compilation errors in policy, utxoset, and dag tests.
* [NOD-208] Changed validateBlockRewardMaturity and CheckTransactionInputsAndCalulateFee to use blueScore.
* [NOD-208] Changed CalcBlockSubsidy to use blueScore.
* [NOD-208] Changed SequenceLockActive to use blueScore.
* [NOD-208] Removed ExtractCoinbaseHeight.
* [NOD-208] Removed reference to block height in ensureNoDuplicateTx.
* [NOD-208] Changed IsFinalizedTransaction to use blueScore.
* [NOD-208] Fixed merge errors.
* [NOD-208] Made UTXOEntry serialization use blueScore.
* [NOD-208] Changed CalcPriority and calcInputValueAge to use blueScore.
* [NOD-208] Changed calcSequenceLock to use blueScore.
* [NOD-208] Removed blockChainHeight from UTXOEntry.
* [NOD-208] Fixed compilation errors in feeEstimator. Fixed a bug in the test pool hardness.
* [NOD-208] Fixed oldestChainBlockWithBlueScoreGreaterThan not handling an extreme case.
* [NOD-208] Fixed TestDiffFromTx.
* [NOD-208] Got rid of priority and support of free transactions.
* [NOD-208] Fixed TestProcessTransaction.
* [NOD-208] Fixed TestTxFeePrioHeap.
* [NOD-208] Fixed TestAddrIndex and TestFeeEstimatorCfg.
* [NOD-208] Removed unused rateLimit parameter from ProcessTransaction.
* [NOD-208] Fixed tests that rely on CreateTxChain.
* [NOD-208] Fixed tests that rely on CreateSignedTxForSubnetwork.
* [NOD-208] Fixed TestFetchTransaction.
* [NOD-208] Fixed TestHandleNewBlock. Fixed HandleNewBlock erroneously processing fee transactions.
* [NOD-208] Fixed TestTxIndexConnectBlock.
* [NOD-208] Removed the use of Height() from the fee estimator.
* [NOD-208] Removed unused methods from rpcwebsocket.go.
* [NOD-208] Removed Height from util.Block.
* [NOD-208] Removed ErrForkTooOld. It doesn't make sense in a DAG.
* [NOD-208] Made blockHeap use blueScore instead of height.
* [NOD-208] Removed fee estimator.
* [NOD-208] Removed DAG.Height.
* [NOD-208] Made TestAncestorErrors test chainHeight instead of height.
* [NOD-208] Fixed a couple of comments that were still speaking about block height.
* [NOD-208] Replaced all uses of HighestTipHash with SelectedTipHash.
* [NOD-208] Remove blockNode highest and some remaining erroneous uses of height.
* [NOD-208] Fixed a couple of comments. Fixed outPoint -> outpoint merge error.
* [NOD-208] Fixed a couple more comments.
* [NOD-208] Used calcMinRequiredTxRelayFee instead of DefaultMinRelayTxFee for mempool tests.
* [NOD-208] Renamed mempool Config BestHeight to DAGChainHeight.
* [NOD-208] Fixed a bug in oldestChainBlockWithBlueScoreGreaterThan. Made calcSequenceLock use the node's selected parent chain rather than the virtual block's.
* [NOD-208] Removed chainHeight from blockNode String().
Renamed checkpointsByHeight to checkpointsByChainHeight and prevCheckpointHeight to prevCheckpointChainHeight.
Removed reference to chainHeight in blockIndexKey.
Fixed comments in dagio.go.
* [NOD-208] Removed indexers/blocklogger.go, as no one was using it.
* [NOD-208] Made blocklogger.go log blueScore instead of height.
* [NOD-208] Fixed typo.
* [NOD-208] Fixed comments, did minor renaming.
* [NOD-208] Made a "common sense" wrapper around sort.Search.
* [NOD-208] Fixed comment in SearchSlice.
* [NOD-142] Updated util.FastLog2Floor to work on uint64
* [NOD-142] Convert height and chainHeight to uint64
* [NOD-142] A couple fixes in comments of TestFastLog2Floor
* [NOD-142] Make spendableOutOffset uint64 too
* [NOD-122] Handle each message in rpcclient with a separate goroutine
* [NOD-122] Stop listening to new blocks when not mining
* [NOD-122] Made RPC logging in mining simulator more explicit + some styling enhencement
* [NOD-115] Add timeout to rpcclient requests
* [NOD-115] Add timeout of half a second to mining simulator requests
* [NOD-115] Remove redundant allocation of responseChan
* [NOD-70] Added GetBlockTemplate method to rpcclient
* [NOD-70] Basic infrastructure for mining simulator
* [NOD-70] Fix txFees in NewBlockTempalte: include value for fee transaction + don't set fee for coinbase = -totalFees.
* [NOD-70] Added capabilities parameter to Client.GetBlockTemplate call
* [NOD-70] Dirty version of mining simulator complete
* [NOD-70] cleaned up mining simulator
* [NOD-70] Added dockerfile to mining simulator
* [NOD-70] Updated base config path of mining simulator to mining_simulator
* [NOD-70] Remove error return from msgblock.AddTransaction - it never returns one
* [NOD-70] Renamed r -> random
* [NOD-70] Move paths initialization of mining simulator to main
* [NOD-70] Cleaned up mining simulator dockerfile
* [NOD-70] Add '--' to tini argument
* [NOD-63] Merge BlockAccepted and BlockConnected notifications into BlockAdded + remove BlockDisconnected notifications
* [NOD-63] Many instances of chain->DAG and similar
* [NOD-63] Some more chian -> DAG
* [DEV-376] Changed any instance of %v in format strings with a more specific format token
* [DEV-376] Fixed some more wrong formatting strings + removed redundant
cast
* [DEV-376] Added fmt.Sprintf where it was missing
* [DEV-376] use %s for util.Amount, to invoke .String()
* [DEV-376] Some more fixes in format strings
* [DEV-376] fixed mruinvmap_test to expect the correct behaviour
* [DEV-361] Create type TxID as alias to daghash.Hash. Use it for transaction IDs
* [DEV-361] Fixed missed renames
* [DEV-361] Removed usage of zeroHash
* [DEV-361] Fixed more missed renames
* [DEV-319] Implemented transaction data sending logic.
* [DEV-319] Implemented NotifyNewTransactions command validation.
* [DEV-319] Reduced some duplication in notifyForNewTx.
* [DEV-319] Renamed a parameter for clarity.
* [DEV-319] Added a test for marshalling/unmarshalling the new varient of notifyNewTransactions.
* [DEV-319] Added a check in handleNotifyNewTransactions to avoid unnecessary validation.
* [DEV-319] Added comments to explain the initialization of marshalledJSONVerboseFull and marshalledJSONVerbosePartial.
* [DEV-242] Modified some help functionality to convert to lowercase camel case instead of just lowercase.
* [DEV-242] Corrected help functionality for struct field names.
* [DEV-242] Corrected help functionality for struct names.
* [DEV-242] Cleaned up toLowercaseCamelCase.
* [DEV-242] Renamed toLowercaseCamelCase to toCamelCase.
* [DEV-242] Converted the rest of the stuff in rpcserverhelp.go to camelCase. Fixed a bug in the camelCase converter.
* [DEV-242] camelCase-ified the last few RPC parameter names.
* [DEV-242] Fixed an off-by-one bug in toCamelCase.
* [DEV-242] Changed back from "jsonRpc" to "jsonrpc".
* [DEV-242] Moved toCamelCase into utils, wrote unit tests for it, and fixed an off-by-one bug.
* [DEV-242] Re-exported DefaultHomeDir because it's required in windows_service.go.
* [DEV-242] Added a comment above DefaultHomeDir to satisfy golint.
* [DEV-242] Formatted config/config.go.
* [DEV-134] Implement Continuous Integration
Squashed commit:
[5e41d830] Dev 223 fix txindex (#100)
* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits
* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG
* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG
* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG
* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG
* [DEV-204] add explanation about difficulty in CurrentBits() comment
* [DEV-204] unexport VirtualBlock type
* [DEV-223] make applyUTXOChanges return pastUTXOResults
* [DEV-223] add bluestxdata for current block as well
* [DEV-223] re-design tx index
* [DEV-223] edit txindex comments
* [DEV-223] rename BluesTxData -> AcceptedTxData, and return from applyUTXOChanges only transactions that got accepted
* [DEV-223] add unit test for txindex
* [DEV-223] fix comments and unite blueTransaction and AcceptedTxData to one type
* [DEV-223] use bucket cursor for dbFetchFirstTxRegion
* [DEV-223] use the same cursor instance for dbFetchFirstTxRegion
* [DEV-223] write in dbFetchFirstTxRegion's comment that it returns the first block region
* [DEV-223] rename type BlueBlockTransaction to TxWithBlockHash
* [DEV-223] add named returned value for applyUTXOChanges
[4c95e293] [DEV-134] Made golint ignore the vendor directory.
[21736dbc] [DEV-134] Renamed ExampleBlockChain_ProcessBlock to ExampleBlockDAG_ProcessBlock to satisfy go vet.
[beea6486] [DEV-134] Removed pushing the built docker to a remove repository. That's unnecessary at this stage.
[bee911ed] [DEV-134] Made all precompilation checks run on everything instead of only the root dir.
[585f92ae] [DEV-134] Added "github.com/pkg/errors" to dep.
[5f02f570] [DEV-134] -vendor-only is written with only one hyphen.
[3eee7f95] [DEV-134] go vet instead of go tool vet.
[0c2d4343] [DEV-134] Split all the pre-compile checks to separate lines to be able to tell which of them is failing.
[780519c8] [DEV-134] Ran gofmt on everything.
[8247146b] Dev 223 fix txindex (#100)
* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits
* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG
* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG
* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG
* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG
* [DEV-204] add explanation about difficulty in CurrentBits() comment
* [DEV-204] unexport VirtualBlock type
* [DEV-223] make applyUTXOChanges return pastUTXOResults
* [DEV-223] add bluestxdata for current block as well
* [DEV-223] re-design tx index
* [DEV-223] edit txindex comments
* [DEV-223] rename BluesTxData -> AcceptedTxData, and return from applyUTXOChanges only transactions that got accepted
* [DEV-223] add unit test for txindex
* [DEV-223] fix comments and unite blueTransaction and AcceptedTxData to one type
* [DEV-223] use bucket cursor for dbFetchFirstTxRegion
* [DEV-223] use the same cursor instance for dbFetchFirstTxRegion
* [DEV-223] write in dbFetchFirstTxRegion's comment that it returns the first block region
* [DEV-223] rename type BlueBlockTransaction to TxWithBlockHash
* [DEV-223] add named returned value for applyUTXOChanges
[bff68aa3] [DEV-134] Gave executable permission to deploy.sh
[638a99d9] [DEV-134] Added jenkinsfile and deploy script.
* [DEV-134] Added a robust testing script.
* [DEV-134] Fixed a bash-ism.
* [DEV-134] Disabled testing with coverage for now.
* [DEV-134] Disabled golint and removed removing debug symbols.
* [DEV-134] Disabled aligncheck.
* [DEV-134] Disabled structcheck and varcheck.
* [DEV-134] Added "don't inline functions" to compiler flags for testing.
* [DEV-134] Made build fail if gofmt prints out anything.
* [DEV-134] Fixed misleading comment.
* [DEV-134] Added comments to test.sh.
* [DEV-134] Renamed tm to measure_runtime and removed do_ prefixes from functions.
* [DEV-134] Fixed gofmt line in build script.
* [DEV-134] Fixed gofmt some more.
* [DEV-134] Fixed gofmt not actually failing due to logical or.
* [DEV-97] Moved github.com/daglabs/btcutil into github.com/daglabs/btcd/btcutil.
* [DEV-97] Updated Gopkg.toml to no longer refer to btcutil.
* [DEV-97] Renamed btcutil to util.
* [DEV-42] Fixed rpcserverhelp.go.
* [DEV-42] Fixed GetBlockHeaderVerboseResult, GetBlockVerboseResult, and GetBlockTemplateResult.
* [DEV-42] Fixed rpcserver.go.
* [DEV-42] Got rid of the rescan command. Apparently it was deprecated and succeeded by the rescanBlocks command.
* [DEV-42] Modified handleRescanBlocks to satisfy compilation.
* [DEV-42] Fixed failing tests in rpcserver.go and rpcserverhelp.go.
* [DEV-42] Removed tests for rescan.
* [DEV-42] Removed rescan from notify.go.
* [DEV-42] Fixed a couple of comments I've missed.