Commit graph

3587 commits

Author SHA1 Message Date
Johan T. Halseth 37a6e8485b
rpctest: add witness commitment when calling CreateBlock
If we tried to include transactions having witnesses, the block would be
invalid since the witness commitment was not added.
2021-04-26 13:53:53 +02:00
Johan T. Halseth f0f4784c1c
mining: extract witness commitment add into method 2021-04-26 13:53:22 +02:00
Oliver Gugger 7d1ab0b4d7
btcctl: add signet param
This commit adds the --signet command line flag to the btcctl utility.
2021-04-22 13:10:45 +02:00
Oliver Gugger 8a62cf0ef5
rpcserver: add taproot deployment to getblockchaininfo 2021-04-22 13:10:45 +02:00
Oliver Gugger 3eac153437
config+params: add signet config option
This commit adds the --signet command line flag (or signet config
option) for starting btcd in signet mode.
2021-04-22 13:10:45 +02:00
Oliver Gugger 73ecb5997b
wire+chaincfg: add signet params
This commit adds all necessary chain parameters for connecting to the
public signet network.
Reference: https://github.com/bitcoin/bitcoin/pull/18267
2021-04-22 13:10:44 +02:00
Aurèle Oulès 2d7825cf70 btcjson: Updated TxRawResult.Version from int32 to uint32 2021-04-13 15:21:09 -04:00
Jake Sylvestre 540786fda6 rpcclient: fix documentation typo 2021-04-13 09:09:20 -04:00
Olaoluwa Osuntokun 36a96f6a00
Merge pull request #1704 from wpaulino/update-btcutil
build: update btcutil dependency
2021-03-31 18:33:23 -07:00
Wilmer Paulino f133593b93
build: update btcutil dependency 2021-03-29 16:59:44 -07:00
Gustavo Chain f86ae60936 addrmgr: Use RLock/RUnlock when possible 2021-03-16 13:24:10 -04:00
Olaoluwa Osuntokun 01c6a6fe9b
Merge pull request #1698 from wpaulino/external-peer-testing
peer: allow external testing of peer.Peer
2021-03-12 16:28:45 -08:00
Wilmer Paulino fdb479f121
peer: allow external testing of peer.Peer
The previous use of allowSelfConns prevented this, as users aren't able
to invoke peer.TstAllowSelfConns themselves due to being part of a test
file, which aren't exported at the library level, leading to a
"disconnecting peer connected to self" error upon establishing a mock
connection between two peers. By including the option at the config
level instead (false by default, prevents connections to self) we enable
users of the peer library to properly test the behavior of the peer.Peer
struct externally.
2021-03-11 18:24:13 -08:00
Gustavo Chain 556620fea6 rpcserver: Fix Error message returned by processRequest
When processRequest can't find a rpc command, standardCmdResult returns
a `btcjson.ErrRPCMethodNotFound` but it gets ignored and a
`btcjson.ErrRPCInvalidRequest` is returned instead.

This makes processRequest return the right error message.
2021-03-09 10:34:32 -05:00
Jake Sylvestre d08785547a docs: update shields 2021-03-05 07:45:19 -05:00
Appelberg-s dff2198fc5 Fix error message returned by EstimateFee
When you provide an argument to EstimateFee(numblocks uint32) that exceeds the estimateFeeDepth (which is set to 25), you get an error message that says "can only estimate fees for up to 100 blocks from now".  The variable used in the if condition and the variable used for creating the error message should be the same.
2021-02-09 09:54:33 -05:00
Jake Sylvestre 2a1aa5129e Add Batch JSON-RPC support (rpc client & server) 2021-02-09 09:47:46 -05:00
Anirudha Bose 31b66488b4 btcec: validate R and S signature components in RecoverCompact 2021-02-09 09:43:01 -05:00
Olaoluwa Osuntokun fa683a69dc
Merge pull request #1689 from cfromknecht/hashcache-flake
txscript/hashcache_test: fix flake due to resetting RNG
2021-02-03 19:32:39 -08:00
Conner Fromknecht 5300a19d06
txscript/hashcache_test: call rand.Seed once in init
This resolves the more fundamental flake in the unit tests noted in the
prior commit.

Because multiple unit tests call rand.Seed in parallel, it's possible
they can be executed with the same unix timestamp (in seconds). If the
second call happens between generating the hash cache and checking that
the cache doesn't contain a random txn, the random transaction is in
fact a duplicate of one generated earlier since the RNG state was reset.

To remedy, we initialize rand.Seed once in the init function.
2021-02-02 13:31:47 -08:00
Conner Fromknecht 1dd693480c
txscript/hashcache_test: always add inputs during getTxn
TestHashCacheAddContainsHashes flakes fairly regularly when rebasing
PR #1684 with:
    txid <txid> wasn't inserted into cache but was found.

With probabilty 1/10^2 there will be no inputs on the transaction. This
reduces the entropy in the txid, and I belive is the primary cause of
the flake.
2021-02-02 12:44:22 -08:00
Dan Cline 77fd96753c txscript: add benchmark for IsUnspendable
- create benchmarks to measure allocations
 - add test for benchmark input
 - create a low alloc parseScriptTemplate
 - refactor parsing logic for a single opcode
2021-02-02 09:20:31 -05:00
Steven Kreuzer 7bbd9b0284 btcjson: Update fields in GetBlockChainInfoResult
Update the fields of GetBlockChainInfoResult to reflect the current state of
the RPC returned by other full-node implementations.

 * InitialBlockDownload - Node is in Initial Block Download mode if True.
 * SizeOnDisk - The estimated size of the block and undo files on disk.
2021-01-26 09:52:38 -05:00
Vinayak Borkar c3ece697da Fixes btcsuite/btcd#1653 2021-01-18 13:51:45 -05:00
Victor Lavaud e747eb9284 Add support for arm32v7 in Dockerfile 2021-01-18 13:50:30 -05:00
ebiiim 12abc84cb2 fixed broken link 2021-01-18 13:48:02 -05:00
Olaoluwa Osuntokun 6bd4c64a54
Merge pull request #1670 from breez/sendaddrv2
Add support for receiving sendaddrv2 message from a peer
2020-12-07 19:32:08 -08:00
Yaacov Akiba Slama 29c9ff351c Add support for receiving sendaddrv2 message from a peer 2020-12-02 12:10:43 +02:00
10gic 610bb55ae8 rpcclient: add ExtraHeaders in ConnConfig 2020-11-24 14:15:14 -05:00
Iskander Sharipov 0886f1e5c1 simplify s[:] to s where s is a slice
Found using https://go-critic.github.io/overview#unslice-ref
2020-11-20 15:43:12 -05:00
Olaoluwa Osuntokun e9c7a5ac64
Merge pull request #1659 from guggero/itest-fixes
integration: optimize harness for better itest control, restore bitcoind compatibility
2020-11-13 16:05:16 -08:00
Oliver Gugger 9e8bb3eddb
btcjson+rpcserverhelp: restore bitcoind compatibility
The PR #1594 introduced a change that made the order of parameters
relevant, if one of them is nil. This makes it harder to be backward
compatible with the same JSON message if an existing parameter in
bitcoind was re-purposed to have a different meaning.
2020-11-12 15:47:51 +01:00
Liran Sharir 9fd26cf795 integration/rpctest: randomizes port in rpctest.New to reduce collisions 2020-11-11 11:37:34 -05:00
Oliver Gugger 65d2b7a18c
integration: allow specifying connection behavior 2020-11-11 14:29:17 +01:00
Oliver Gugger 93cc7f36cf
integration: allow overwriting address generator 2020-11-11 14:24:14 +01:00
Oliver Gugger 9250064837
integration: allow setting custom btcd exe path
To allow using a custom btcd executable, we allow specifying a path to a
file. If the path is empty, the harness will fall back to compiling one
from scratch.
2020-11-11 14:16:08 +01:00
Armando Ochoa f070f7f2be rpcclient: fix documentation typos 2020-11-04 09:56:02 -05:00
Anirudha Bose 535f25593d rpcclient: implement createwallet with functional options 2020-10-26 14:54:05 -04:00
Anirudha Bose 5e56ca05e1 btcjson: add new JSON-RPC errors and document them 2020-10-26 09:35:46 -04:00
Torkel Rogstad 1d75e0a885 rpcclient: add more wallet commands
Implement backupwallet, dumpwallet, loadwallet and unloadwallet.
2020-10-26 09:34:56 -04:00
David Mazary 6adfc07d1e Unmarshal hashes/second as float in GetMiningInfoResult 2020-10-26 09:33:28 -04:00
Anirudha Bose 6519c04a6f rpcclient: implement gettxoutsetinfo command 2020-10-05 10:03:47 -04:00
Henry Fisher 584c382334 rpc: add signrawtransactionwithwallet interface
Adds interface for issuing a signrawtransactionwithwallet command.
Note that this does not add functionality for the btcd rpc server
itself, it simply assumes that the RPC client has this ability and gives
an API for interacting with the RPC client.

rpc: add signrawtransactionwithwallet interface
2020-10-05 09:56:12 -04:00
Anirudha Bose 0bf42f4476 rpcserver: add txid to getblocktemplate response 2020-10-05 09:55:45 -04:00
Olaoluwa Osuntokun 40ae93587d
Merge pull request #1621 from xplorfin/go1.15
ci: add go 1.15 to tests
2020-10-02 14:52:29 -07:00
Anirudha Bose e9a51e8dcd rpcclient: implement getwalletinfo command 2020-09-25 12:18:06 -04:00
Friedger Müffke 1340513786 Fix link to using bootstrap.dat 2020-09-23 08:53:11 -04:00
Anirudha Bose ac3f235eb9 rpcclient: implement getaddressinfo command
Fields such as label, and labelspurpose are not included, since they
are deprecated, and will be removed in Bitcoin Core 0.21.
2020-09-21 09:47:58 -04:00
Elliott Minns 6daaf73544
GetBlockTemplate RPC client implementation (#1629)
* GetBlockTemplate RPC client implementation

* Txid added to the getblocktemplate result

* Omitempty for TxID and improved comment for GetBlockTemplate 'rules' field
2020-09-21 09:42:35 -04:00
Anirudha Bose f4024160f3 btcjson: add test for null params in searchrawtransactions
Closes PR #1476.
2020-09-21 09:42:09 -04:00