Commit Graph

570 Commits

Author SHA1 Message Date
Braydon Fuller f0ec424161 Added bindings to be able to listen to tx leaving mempool. 2015-10-29 16:15:00 -04:00
Braydon Fuller 9d477fb64f Use Nan::CopyBuffer to avoid invalid pointer errors during garbage collection. 2015-10-27 12:28:12 -04:00
Braydon Fuller 7afeef0f08 Debugging, clear warnings, fixed GetBlock. 2015-10-26 10:11:02 -04:00
Braydon Fuller b138877e19 Start upgrade to Node.js 4 2015-10-26 10:11:02 -04:00
Braydon Fuller 7070d4c74d Added critical section lock in isSpent 2015-10-02 14:09:29 -04:00
Braydon Fuller 1490b17f9a Fix bug with getting a block index with unknown height. 2015-10-01 00:21:14 -04:00
Chris Kleeschulte af7966f94a Removed unneeded getTxOutSetInfo 2015-09-25 11:33:51 -04:00
Chris Kleeschulte c3646b4ae3 Nan Macro Updates
- Updated to nan 2.0 (node module)
- Updated the Nan-related macros to 2.0 semantics
2015-09-24 17:10:22 -04:00
Chris Kleeschulte dc390b9e9f Tx Notifier
- There is a new signal called TxToMemPool
- This signal will connect to the bindings slot, queueTx
- When a tx is accepted into the memory pool, the tx will be queued and the tx_notifier will be scheduled
2015-09-23 15:13:24 -04:00
Chris Kleeschulte a7444a92b9 Tx event firing
- The ProcessMessages signal was scheduling/connecting its slots slightly out of order for what we need
- First, the scan_messages needs to run and copy out the stream
- Second, Bitcoin's ProcessMessages needs to run in order to run AcceptToMemoryPool
- Third, scan_messages_after needs to run in order to signal our tx_monitor
- In order to make this happen, we need to pair ProcessMessages slot to the scan_messages slot and order that
- Then, AFTER those two complete, we can schedule scan_messages_after
2015-09-23 13:05:52 -04:00
Chris Kleeschulte 402d01d7ac Next Block Hash Bindings
- Added bindings for next block hash
- Added the reg/unit tests
2015-09-21 14:07:14 -04:00
Patrick Nagurny 4a5031a917 Merge pull request #240 from braydonf/gettxoutsetinfo
Add binding for getting transaction output set information.
2015-09-18 13:20:46 -04:00
Braydon Fuller 68368397d3 Add binding to get the best block hash. 2015-09-17 18:11:47 -04:00
Braydon Fuller 4c674a8fbb Add binding for getting transaction output set information. 2015-09-17 17:52:23 -04:00
Braydon Fuller ad120213e1 Start of mempool address index. 2015-09-17 14:26:53 -04:00
Chris Kleeschulte 576d1712e4 Merge pull request #234 from braydonf/sendtxevent
Bindings: Send transaction emit "tx" events.
2015-09-16 10:35:10 -04:00
Braydon Fuller cadbc0a79d GetBlockIndex segmentation fault with genesis block
Fixes an bug where accessing `prevBlockIndex->phashBlock` for the
genesis block would cause a segmentation fault with an error of
"Cannot access memory at address 0x0". As the genesis block doesn't
have a previous hash, it will now set the "prevHash" to "null".
2015-09-16 09:23:13 -04:00
Braydon Fuller cf1c01acea Bindings: Send transaction emit "tx" events. 2015-09-15 18:31:52 -04:00
Chris Kleeschulte 1ac02c5276 Performed lexical cast on the reject code instead of using a sprintf. 2015-09-10 13:20:06 -04:00
Patrick Nagurny 0ff742c1b6 add isMainChain method 2015-09-08 17:38:59 -04:00
Isidoro Ghezzi 21a7bae2f1 avoid undefined behaviour
TODO: use boost::lexical_cast or C++11 std::to_string
2015-09-04 19:28:16 +02:00
Chris Kleeschulte f08a9c66bf New way to persist callbacks to alleviate calling of setImmediate. 2015-09-02 10:46:40 -04:00
Patrick Nagurny a68cf4ecf8 Web service and other changes in preparation for insight-api 2015-08-31 12:54:28 -04:00
Chris Kleeschulte f4a1f7b12a Removed signal handlers from bitcoind.
- when using bitcoin as a shared lib, there should not be any need for bitcoind to be handling its own signals.
2015-08-24 13:29:42 -04:00
Patrick Nagurny b0ab45f3f7 handle signals and stop correctly 2015-08-24 13:29:42 -04:00
Patrick Nagurny 164a2cad75 cleanup daemon 2015-08-24 13:29:42 -04:00
Braydon Fuller a65a097e8a Merge pull request #134 from kleetus/regtest_ready_event
Regtest and wallet ready event
2015-08-21 15:00:54 -04:00
Chris Kleeschulte c4ee586bd7 Added CFLAGS for the bindings so that they know that the wallet is compiled in. 2015-08-19 16:33:01 -04:00
Chris Kleeschulte 862d36191b Corrected the preprocessor directive. 2015-08-19 11:01:48 -04:00
Chris Kleeschulte a68e51ffc4 Regtest and wallet ready event
- Added a check for the wallet availability during onBlocksReady
- Fixed a problem with spaces being added at the end of the file by git diff
2015-08-18 17:56:35 -04:00
Patrick Nagurny 78bc054bfa changes for BWS integration 2015-08-14 11:15:07 -04:00
Patrick Nagurny 223aebf98c Merge pull request #117 from kleetus/blockchain_synced
GetProgress, will report the GuessVerificationProgress for the blockchain
2015-08-12 15:32:09 -04:00
Chris Kleeschulte 8115d92de9 Removed verifyScript and related methods that we don't currently use. 2015-08-12 12:38:33 -04:00
Braydon Fuller ffddc9d9b5 Fix declarations for IsSynced and SyncPercentage 2015-08-11 17:58:25 -04:00
Braydon Fuller 6584974413 Emit "synced" event when bitcoind is synced
- Added daemon IsSynced method
- Renamed GetProgress to SyncPercentage
- Improved logging when syncing is finished
2015-08-11 17:24:30 -04:00
Chris Kleeschulte f2c6d310ae GetProgress
- uses the same routine as the log reporter in bitcoin
- essentially divides the chainParams checkpoints by the current tip
2015-08-11 12:31:54 -04:00
Braydon Fuller 682f3999ec Fix bug with transaction message processing
- Copy the message so that the message can be later processed
- Connect at the front to be able to scan but not seek
- Emit event after process message and accept to mempool
- Include node buffer, hash and mempool status of the transaction in result
2015-08-07 11:05:04 -04:00
Braydon Fuller a952c3e417 Added regtests for getTransaction 2015-08-03 17:41:11 -04:00
Braydon Fuller 286f917dd0 Fix "Abort trap 6" bug
- Added CCriticalSection LOCK
- Removed the use of uv_mutex_lock
2015-08-03 16:10:58 -04:00
Braydon Fuller f4061037b6 Update name to Bitcore Node 2015-07-31 13:26:48 -04:00
Patrick Nagurny 4a4e71797a getTransactionWithBlockInfo 2015-07-31 11:13:33 -04:00
Braydon Fuller 49587b7e2d Process tx messages
- Check for tx command when processing messages
- Emit tx events from the daemon
- Start the txmon when the daemon starts
2015-07-30 20:26:08 -04:00
Braydon Fuller 6f56df0c6f Added p2p message signal bindings. 2015-07-30 18:05:03 -04:00
Braydon Fuller 2ca3a48884 Expose estimateFee method. 2015-07-28 16:03:55 -04:00
Braydon Fuller 93ed8bfd8d Fix bug with feedback loop during shutdown
- Use height to indicate tip change by comparing heights
- Give undefined for callback when shutting down
2015-07-24 12:32:28 -04:00
Braydon Fuller 4189e3548a Tests for tip_update
- Exit tip_update thread on shutdown
- Check that the tip update event is fired
2015-07-23 23:29:01 -04:00
Braydon Fuller 9eda30ae2b Handle forks with bitcoindSync
- added bindings to listen for tip updates from the daemon
- update the height during syncing for continuity
- call sync when there is a new tip
- added ability to rewind to a ancestor when there is a fork
2015-07-23 20:06:19 -04:00
Braydon Fuller 7b8268d0e0 Use prevHash from bitcoind block index
- Changed method getChainWork into getBlockIndex
- Added prevHash to getBlockIndex result
2015-07-22 16:56:17 -04:00
Braydon Fuller 2312e53038 Fix compilation of bindings for SendTransaction. 2015-07-22 10:57:01 -04:00
Braydon Fuller 796d7682f8 Add sendTransaction method to the daemon. 2015-07-22 10:57:01 -04:00