Commit graph

325 commits

Author SHA1 Message Date
Ben Carman
7bbc89fb33
Optimize GetHeadersMessage.fromBytes (#2131) 2020-10-06 06:35:29 -05:00
Chris Stewart
6ce7d3d701
Upgrade to scalac 2.13.3 (#2115) 2020-10-04 07:42:44 -05:00
Nadav Kohen
c7e5c634f3
Brought down ecdsa adaptor signatures implemented in scala from the dlc-crypto branch (#2034) 2020-10-02 10:43:59 -05:00
Ben Carman
4ac93660d2
Add BIP45 Multisig Purpose (#2103)
* Add BIP45 Multisig Purpose

* Fix multisig purpose, add tests
2020-10-02 10:43:25 -05:00
Ben Carman
f69678d74b
Allow any HDCoinType (#2097) 2020-10-02 10:42:59 -05:00
Ben Carman
ead4eaa147
Make bitcoind extend chain api (#2087) 2020-10-02 06:19:56 -05:00
Ben Carman
f7b97ba36e
Use SubtractFeeFromOutputsFinalizer when sending full utxos (#2072) 2020-10-01 17:32:24 -05:00
Ben Carman
d158f4fcb0
Calculate HRP from network param instead of the inverse (#2079)
* Calculate HRP from network param instead of the inverse

* make hrp lazy

* Fix imports
2020-09-29 17:00:46 -05:00
Ben Carman
c2315082d8
Create ExtPrivateKeyHardened (#2073) 2020-09-29 06:35:41 -05:00
Ben Carman
b59a17def0
Add ability to fully spend utxos (#2063)
* Let RawTxSigner dummy sign transactions

* Add ability to fully spend utxos

* Fix NeutrinoNodeWithWalletTest

* Fix test, simplify call
2020-09-27 08:16:26 -05:00
Ben Carman
856f88f0dd
Initial SigNet support (#2057) 2020-09-25 12:29:13 -05:00
Ben Carman
d5a1c8f39b
Put fee in funding error message (#2050) 2020-09-23 12:17:23 -05:00
Ben Carman
52ef7d6980
Change requesting filters log to use big endian hashes (#2048) 2020-09-23 12:02:34 -05:00
Nadav Kohen
cc3d5ea639
Fixed PSBT.verifyFinalizedInput (#2040)
* Fixed PSBT.verifyFinalizedInput to allow NonWitnessUTXO to be set with a WitnessUTXO

* Added unit test

* Fixed bug where verifyFinalizedInput was also broken for P2SH(Segwit)
2020-09-21 17:01:27 -05:00
Ben Carman
7c4822f67a
Have RawTxSigner use low R signing (#1722) 2020-09-21 11:30:15 -05:00
Ben Carman
36b45790cf
Merge pull request #2029
* Add more processing blocks tests

* Add immature coinbase txo state

* Test balance, add doc
2020-09-20 10:39:31 -05:00
Ben Carman
8361ff6e08
Merge pull request #2019
* Refactor logging to only use grizzled slf4j

* Fix docs

* test travis config change
2020-09-19 14:09:12 -05:00
Chris Stewart
98cb6f78c7
2020 09 18 btchrp stringfactory (#2031)
* Implement StringFactory on the companion object for BtcHumanReadablePart

* Make Bech32.checkHrpvalidity() take in a string rather than a Bech32HumanReadablePart as a parameter, now we check validity _just_ according to the bech32 standard, not specific applications light lightning / bitcoin

* Add missing override

* Overload Bech32.checkHrpValidity() to pass in a 'StringFactory' in cases where you know what HRP you expect

* Do nadav's suggestion on Bech32.splitToHrpAndData() -- allow a factory to be passed in parameterized with the type you expect
2020-09-18 13:45:32 -05:00
Chris Stewart
2f6ff1d955
Make ChainApi.getHeadersBetween() be inclusive on the 'from' parameter (#2009)
* Make ChainApi.getHeadersBetween() be inclusive on the 'from' parameter

* Use ben's suggestion of comparing hashes
2020-09-12 11:13:03 -05:00
Chris Stewart
449e205b8b
Introduce 'FilterSyncMarker' to ChainApi, make it clearier what exact… (#2003)
* Introduce 'FilterSyncMarker' to ChainApi, make it clearier what exactly the (Int,DoubleSha256Digest) tuple is returned from ChainApi.nextBlockHeaderRange()

* Fix doc

* Add scaladoc to FilterSyncMarker

* Rebase onto master, fix conflicts to use FilterSyncMarker
2020-09-11 13:48:40 -05:00
Chris Stewart
72cfd4bd4c
Make BlockHeader, BlockHeaderDb have better toStrings (#2007)
* Make BlockHeader, BlockHeaderDb have better toStrings

* Address ben's code review
2020-09-11 13:46:26 -05:00
Chris Stewart
7b4b4a290f
Resolve issues with reorgs and syncing filters (#1969)
* Pull over test cases, WIP

* Rework ChainHandler.nextBlockHeaderRange() to use hashes rather than heights to very integrity of header chain, add test case

* Modify test case to make sure we are generating the 'heaviest chain work' header as first in the tuple that is used in reorg test cases

* Refactor to helper method called 'findNextHeader()' to make things simpler

* Add scaladoc to ChainHandler.findNextHeader()

* WIP

* Fix bugs in ChainApi.nextBlockHeaderRange(), now return (startHeight,stopHash) rather than (stopHeight,stopHash)

* Get chain handler tests passing, remove genesis filter header/fitler from default chain project fixture, make it a specialized one to have genesis filter header/filter in the database. Use that specialized fixture in ChainHandlerTest for now

* FilterSync work without having the genesis filter and filter header inserted into the database

* fix bug in DataMessageHandler where we were using sendNextGetCompactFilterHeadersCommand rather than using peerMsgSender.sendGetCompactFilterHeadersMessage

* Refactor ChainHandler.findNextHeader() to centralize where chains are fetched

* Address ben's code review
2020-09-11 12:41:25 -05:00
Ben Carman
24dfa7200a
Create FeeUnitFactory and functions to calculate tx fee rates (#1990)
* Create FeeUnitFactory and functions to calculate tx fee rates

* Remove useless override, use factory

* doc

* Scaladocs + use vals

* Fix scaleFactor being set as default value
2020-09-10 06:45:25 -05:00
Chris Stewart
ff878c532b
Use randomized fee rates for wallet tests (#1977)
Co-authored-by: Ben Carman <benthecarman@live.com>
2020-09-09 16:46:33 -05:00
Ben Carman
a7c06a11cb
Add chainHash to ChainParams (#1972)
* Add chainHash to ChainParams

* Rename to genesisHash
2020-09-04 12:15:06 -05:00
Chris Stewart
893d036ab6
Rename ChainApi.nextHeaderBatchRange -> ChainApi.nextBlockHeaderBatchrnage (#1957) 2020-09-02 13:19:20 -05:00
Ben Carman
45c11f25ec
Fix max by for getBlockCount (#1951)
* Fix max by for getBlockCount

* Add helper func to package
2020-09-01 19:38:15 -05:00
Chris Stewart
5909a57f09
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
Ben Carman
4104e0c973
Fix rescans that are larger than the batch size (#1916)
* Fix rescans that are larger than the batch size

* Add test
2020-08-27 14:09:25 -05:00
Chris Stewart
be891596b6
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
a9ad927a9c
Apply string factory to a bunch of easy things (#1891)
* Apply string factory to a bunch of easy things

* Refactor HDPath, ExtKey, and LnTagPrefix to use StringFactory

* Implemen StringFactory on LnHumanReadablePart, ScriptType, ServiceIdentifier

* Implement StringFactory on AesCrypt, NodeUri, AddressTag, PSBT, TxoState

* Fix failing tests, fix website compile

* Apply StringFactory to all ScriptOperations, ChannelState, Script Parsing
2020-08-25 10:48:37 -05:00
Ben Carman
ef9bd4165d
Add new hash preimage PSBTInput types (#1893) 2020-08-25 10:23:21 -05:00
Ben Carman
4cdbeafb58
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
66ec89bcab
Move WalletApi to Core (#1890) 2020-08-25 07:05:20 -05:00
Ben Carman
f96bb97a9e
Remove 2.11 specfic files (#1892) 2020-08-25 06:41:41 -05:00
Ben Carman
28ff3186e4
Move WalletApi necessities to core (#1886) 2020-08-24 17:26:58 -05:00
Scala Steward
4186be51e0
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
Ben Carman
acbdbfac41
Move all remaining wallet db representations (#1885) 2020-08-24 13:13:52 -05:00
Ben Carman
f1b228a8ce
Move TransactionDb to Core (#1849)
* Move TransactionDb to Core

* Move to api package
2020-08-22 08:04:30 -05:00
Ben Carman
f757120681
Move AddressTagDb to Core (#1850)
* Move AddressTagDb to Core

* Move to wallet api package
2020-08-21 16:31:30 -05:00
Ben Carman
02f02fb22b
Create KeyManager Api & move SpendingInfoDb to core (#1848)
* Create KeyManager Api & move SpendingInfoDb to core

* Fix docs, remove sealed form KeyManagerApi

* Move SpendingInfoDb to core wallet api
2020-08-21 14:37:12 -05:00
Nadav Kohen
2a1c399838
Implement basic TLV functionality (#1847)
* Defined BigSizeUInt as in BOLT 1

* Introduced UInt16 and TLV types

* Responded to review

* Responded to review
2020-08-20 14:42:16 -05:00
rorp
874a96eb1e
Refactor wallet DB (#1798)
* Refactor wallet DB

* fix create(), update() and upsert()

* remove accout foreign key

* fix wallet fixtures

* update Postgres schema

* update SQLite schema

* fix AddressHandlingTest

* fix SQLITE_BUSY exception in TransactionProcessing

* fix RescanHandlingTest

* revert NeutrinoNodeTest

* fix SpendingInfoDAOTest

* fix SQLITE_BUSY exceptions

* fix DbManagementTest

* fix "Task rejected" Slick exceptions in Postgres mode

* responded to the PR comments
2020-08-18 13:43:12 -05:00
Chris Stewart
ff8f922684
Batch and execute headers for chain work calculation test case, this … (#1837) 2020-08-15 14:05:01 -05:00
Chris Stewart
d65f68ea21
2020 08 14 issue 1829 (#1833)
* Fix O(n^2) behavior in BaseBlockchain.connectWalkBackwards, cache BlockHeader.hash after the first time it is called

* Revert a few files
2020-08-15 07:31:50 -05:00
Chris Stewart
cad3c64cda
Output logger configuration on startup now (#1814)
* Output logger configuration on startup now

* Remove core-test/logback-test.xml and core/common-logback.xml, consolidate and move them into testkit/src/main/resources/logback.xml

* Add comment for logging configuration
2020-08-13 12:36:42 -05:00
Ben Carman
1f6e2249ea
Address Tagging/Labeling Support from CLI (#1790)
* Address Tagging/Labeling Support from CLI

* Scaladoc
2020-08-12 10:55:15 -05:00
Chris Stewart
fa388c7448
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
e2294414bf
Send correct version message on node start up (#1793) 2020-08-11 09:11:04 -05:00
Chris Stewart
d31806f76f
Add synchronous version of StartStop (#1771)
* Add synchronous version of StartStop

* Use ben's suggestion of StartStopAsync extending StartStop
2020-08-06 18:24:12 -05:00