Commit Graph

96 Commits

Author SHA1 Message Date
rorp
c62be8b5f6 Update callbacks for LN support (#1938)
Update callbacks for LN support
2020-09-09 11:02:31 -07:00
Chris Stewart
98236835a5 Rename ChainApi.nextHeaderBatchRange -> ChainApi.nextBlockHeaderBatchrnage (#1957) 2020-09-02 13:19:20 -05:00
Chris Stewart
e7993890cb Make sure both filter ehaders and filters are empty before sending fi… (#1936)
* Make sure both filter ehaders and filters are empty before sending first filterheader sync message

* Address nit
2020-08-31 06:32:01 -05:00
Chris Stewart
d3af9c2ccb Implement getBestFilterHeader based on a number of block headers that… (#1926)
* Implement getBestFilterHeader based on a number of block headers that can be passed in as a parameter. These headers can be used to indicate what your current best chain is

* Bring back compiler opts

* Fix compiler error for maxByOption as it isn't in the 2.12 std library

* Implement a context free best filter headers search. The basic strategy is to look at headers in the _future_ of our current best filter header

* Fix bug in sql query were we were doing max chainWork too early on block headers, we needed to filter out headers in our set and _then_ we get the max chain work

* Add more unit tests
2020-08-29 08:13:38 -05:00
Ben Carman
ef4329d283 Warn if peer does not support services we need (#1921) 2020-08-27 13:57:58 -05:00
Chris Stewart
13fbb3f889 Improve logging in DataMessageHandler (#1922)
* Improve logging in DataMessageHandler

* Make hashes in logs big endian

* One more big endian conversion i forgot
2020-08-27 12:39:45 -05:00
Chris Stewart
3ab280a12b Remove AppConfig.initialize() in favor of AppConfig.start() (#1907)
* Remove AppConfig.initialize() in favor of AppConfig.start()

* Fix docs
2020-08-26 16:24:38 -05:00
rorp
23685f124e Add an ability to one Postgres database for all sub-projects (#1897)
* Add an ability to one Postgres database for all sub-projects
2020-08-26 12:20:18 -07:00
Ben Carman
581851f22c Clean up calls in Node and Chain (#1896)
* Clean up calls in Node and Chain

* Remove parens on non-modifying call
2020-08-26 13:04:34 -05:00
Ben Carman
f59015bc39 Send get filters message if we haven't cached any yet (#1900) 2020-08-26 12:56:19 -05:00
Ben Carman
34ef07ef5a Create ADT for NodeType instead of booleans (#1901) 2020-08-26 07:28:35 -05:00
Ben Carman
10425760c3 Simplify Transaction Broadcast (#1872)
* Simplify transaction broadcast

* Assert tx in db, add note on privacy leak
2020-08-25 07:09:09 -05:00
Ben Carman
f468fff7ea Move ChainApi to core (#1888)
* Move Chain Db Reps to core

* Move ChainApi to Core
2020-08-25 07:08:42 -05:00
Ben Carman
3b7858ecfb Update user agent to 0.4.0 (#1887) 2020-08-24 17:20:56 -05:00
Scala Steward
bef9c2648e Update scalafmt-core to 2.6.4 (#1686)
* Update scalafmt-core to 2.6.4

* Format everything

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-08-24 14:24:16 -05:00
Chris Stewart
adf6da5c5d Start calling appConfig.stop() in destruction fixture code (#1868)
* Start calling appConfig.stop() in destruction fixture code

* Address ben's code review
2020-08-21 14:54:23 -05:00
Ben Carman
f187a8c7d5 Fix safely broadcast a transaction twice twice test (#1851) 2020-08-19 06:20:45 -05:00
Ben Carman
f7b9c5722f Use database to calculate number of confirmations (#1789)
* Use database to calculate number of confirmations

* Check block is in best chain

* Use db

* Optimize getNumberOfConfirmations

* Fix compile issue for older versions

* Add better logging messages

* More logs

* Update confs sequentially
2020-08-16 16:15:13 -05:00
Ben Carman
48a7f6f86e Remove default false for useLogbackConf (#1816)
* Remove default false for useLogbackConf

* Fix docs

* Set logging level to WARN for tests
2020-08-14 08:53:07 -05:00
Chris Stewart
ae81dd3bb3 Create more of a project structure in org.bitcoins.core.api, move DbR… (#1799)
* Create more of a project structure in org.bitcoins.core.api, move DbRowAutoInc into the core project

* Get website compiling again
2020-08-12 06:13:23 -05:00
Ben Carman
4932315cbc Send correct version message on node start up (#1793) 2020-08-11 09:11:04 -05:00
Ben Carman
c3dc52ce90 Send GetHeadersMessage using all of our cached headers to prevent reorgs from stalling node (#1758)
* Send GetHeadersMessage using all of our cached headers to prevent reorgs from stalling node

* Add test, improve logging

* Start with correct chains

* Simplify error, change back to createAll
2020-08-10 13:04:12 -05:00
Ben Carman
4ab65abec4 Fix for Wallet confirmed states (#1782)
* Fix for Wallet confirmed states

* Only process if we do not have the header
2020-08-08 08:12:30 -05:00
Ben Carman
9b2daff38b Replace localhost with 127.0.0.1 automatically (#1772) 2020-08-06 18:24:48 -05:00
Ben Carman
d67c547148 Stop requesting merkle block messages while in neutrino mode (#1730) 2020-08-05 13:00:04 -05:00
Ben Carman
e542a00d19 Callbacks to appconfig (#1740)
* Node Callbacks to appconfig

* Move WalletCallbacks to WalletAppConfig

* Update Docs
2020-08-04 12:27:21 -05:00
Ben Carman
a022fbaed1 Batch add filters to database (#1725)
* Process filter headers in batch

* Use correct batch

* Cache filter heights

* Convert to option
2020-08-04 07:30:42 -05:00
Ben Carman
db7af37ac5 Start syncing filters on node startup (#1729) 2020-08-03 17:17:47 -05:00
Ben Carman
51d35e24e9 Fix Node Startup Issue (#1683)
* Fix Node Startup Issue

* Small fixes

* Add option to force chain work recalc
2020-07-29 09:37:20 -05:00
Nadav Kohen
faf2e0148a Fix All Loggers! (#1695)
* Fixed logging so that appenders are always started when logging is happening

* Started rolling policy so that file appenders could start in getLoggerImpl
2020-07-28 07:13:38 -05:00
Ben Carman
5c9cbbdfc1 Skip downloadBlocks if given an empty Vector (#1690) 2020-07-21 13:59:07 -05:00
Ben Carman
f7037c00a2 Drop AutoInc col for Broadcastable Transaction Table (#1630) 2020-07-07 09:56:34 -05:00
Ben Carman
365d98da10 Add extra logs, fix best filter bug (#1624)
* Add extra logs, fix best filter bug

* Fix to work for when filter count != header count

* Put blockheader items baack in place
2020-07-06 11:38:53 -05:00
Ben Carman
cd594ab069 AppConfig Start Interface (#1598)
* AppConfig Start Interface

* Use StartStop interface
2020-06-21 09:33:43 -05:00
Ben Carman
157c84a4e0 Have BroadcastTransactionTest rebroadcast on failure (#1561) 2020-06-19 14:41:53 -05:00
Scala Steward
97a4886c6e Update scalafmt-core to 2.6.0 (#1579)
* Update scalafmt-core to 2.6.0

* Upgrade scalafmt, fix all formatting errors

* Scalafmt on 2.12

* fix test

* More fixes

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-19 10:38:12 -05:00
Nadav Kohen
e5bd6e53a3 Added compile scope scalafmtCheck to travis runs (#1563) 2020-06-16 15:16:43 -05:00
Chris Stewart
dec503f561 2020 06 12 mv to appconfig (#1553)
* Move hasWallet() to WalletAppConfig

* Move helper methods to create data dstructures in a project to their respective AppConfig file
2020-06-16 12:49:32 -05:00
Ben Carman
1731bd3163 Callback rework (#1542) 2020-06-15 17:30:08 -05:00
Chris Stewart
32c06cbe81 2020 06 05 mv chainwork calc (#1519)
* Fix Chaindb chainwork Migration

* Move chain work calculation out of node, use the ChainApi returnd by runChainWorkCalc()

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-05 11:04:09 -05:00
Chris Stewart
aaa750b23a Add more descriptive log message in P2PClient when we get disconnectd (#1514) 2020-06-04 16:25:04 -05:00
Ben Carman
61d9f0efba Implement best block hash correctly (#1452)
* Implement best block hash correctly

* Handle no common history

* Fix getBlockProof to be BigInt instead of UInt32

* Fix warnings

* Make get best filter use chainwork

* Remove unused function, test isMissingChainWork

* Fix comparisons for chain work in sql

* Fix migrations from rebase

* Fix CI error

* Fix postgresql
2020-06-04 12:05:10 -05:00
rorp
823a392e98 PostgreSQL support (#1315) 2020-06-02 16:37:48 -05:00
Chris Stewart
d8170f319a Implement AppConfigFactory (#1462)
* Implement AppConfigFactory

* Fix docs
2020-05-25 14:43:37 -05:00
Ben Carman
99db9062ac Add option to correctly use logback config (#1398)
* Logger now uses correct parent logger for all, names appenders correctly

* Set logback to true for tests, rename file

* Fix docs
2020-05-20 15:46:24 -05:00
Nadav Kohen
a503441619 Crypto Project Refactor (#1380)
* Added crypto project and decoupled BitcoinSLogger from NetworkElement

Decoupled BitcoinSLogger from Factory

Moved NetworkElement into crypto project

Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project

Moved MaskedToString to crypto project

Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint

Moved the rest of crypto stuff to the crypto project

Moved crypto tests to crypto-test project

* Added documentation for crypto project
2020-04-30 12:34:53 -05:00
Ben Carman
fddca91e79 Neutrino Logging (#1382) 2020-04-30 09:05:26 -05:00
Ben Carman
6d7685b76e Add wallet creation time for rescans (#1353)
* Add wallet creation time for rescans

* Fix docs

* Clean up and add test

* Remove account bday

* Fix compile issue and docs

* Add more chain handler tests

* Use Instant over Long, add docs

* Fix docs
2020-04-29 09:49:41 -05:00
Ben Carman
b8331d4cf1 Re-enable NeutrinoNodeWithWalletTest for Linux (#1366)
* Re-enable NeutrinoNodeWithWalletTest with it disabled for mac

* Change to only Linux

* Only disable for CI runs

* Move IsCI to BitcoinSUtil

* Fix compile issue for earlier versions

* Fix syncing compact filters to not skip last filter

* Fix test to be compatible with new start state

* Use correct isCI

* Fix compile issue

* set CI env
2020-04-27 18:20:47 -05:00
Ben Carman
37c62369eb Batch processing compact filters (#1363)
* Batch processing compact filters

* Use one vector, rename param

* Fix compile issue on older versions

* Process sequentially
2020-04-26 09:34:41 -05:00