Commit Graph

4068 Commits

Author SHA1 Message Date
Marco Peereboom
684d64ad74
Add support for wtxidrelay message. (#2272)
* Add support for wtxidrelay message.

This adds support for the wtxidrelay (BIP339) message in wire.

While here, add tests for sendaddrv2 and rename AddrV2Version to
SendAddrV2Version in order to make the code consistent with all other
messages. This diff does keep the old AddrV2Version constant for
backwards compatibility.

* Bump copyrights
2024-11-06 13:03:27 +00:00
Oliver Gugger
24eb815168
Merge pull request #2256 from ziggie1984/timeout-https-client
rpcclient: add timeout to http request.
2024-10-11 06:58:36 -06:00
ziggie
44c874f9f6
rpcclient: add http timeout 2024-10-10 10:05:01 +02:00
Abirdcfly
ee68dc66a8
btcec+mempool: delete minor unreachable code caused by t.Fatal
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2024-10-08 15:09:20 +02:00
Santiago Rincon
b513ac2da7
docs: correct link to redirect to btcutil docs 2024-10-08 15:05:33 +02:00
Afanti
433781aaff
multi: fix typos 2024-10-08 14:47:41 +02:00
omahs
019988b696
multi: fix typos 2024-10-08 14:41:44 +02:00
Olaoluwa Osuntokun
b4afc08a35
Merge pull request #2228 from lencap/master
chore: fix some comments
2024-10-08 14:40:33 +02:00
Oliver Gugger
e9b505dc7e
Merge pull request #2255 from huochexizhan/master
Formatting code with gofmt
2024-10-08 04:35:02 -06:00
huochexizhan
35df8015ba Formatting code with gofmt
Signed-off-by: huochexizhan <huochexizhan@outlook.com>
2024-09-25 17:56:44 +08:00
Olaoluwa Osuntokun
67b8efd3ba
Merge pull request #2245 from guggero/getnetworkinfo-warnings
btcjson: turn warnings into StringOrArray type
2024-09-21 14:29:13 +09:00
Oliver Gugger
ed879eac20
btcjson: turn warnings into StringOrArray type
Fixes #2224 and lightningnetwork/lnd#9053.

Depending on the version of Bitcoin Core, the "warnings" field in the
response to getnetworkinfo is either a single string value or an array
of strings.
We can easily parse those two variants with a custom type that
implements an UnmarshalJSON method.
2024-09-02 15:38:35 +02:00
Oliver Gugger
2b53ed1989
Merge pull request #2230 from wydengyre/rpcclient-signet
rpcclient: signet support
2024-08-26 01:57:00 -06:00
Bruno Garcia
1a1dd2a2b3
btcjson: check if both begin and end are numbers in UnmarshalJSON 2024-08-23 12:22:54 -07:00
Olaoluwa Osuntokun
029e5a3cb5
Merge pull request #2233 from jharveyb/txid_string_check
wire: check TXID length before creating outpoint
2024-08-15 16:03:51 -07:00
Olaoluwa Osuntokun
bda7977a9a
Merge pull request #2235 from AlexsandroRyan/pkg-update-checkmarx-cve
Updated btcd dependency of btcutil to address CVE-2024-34478
2024-08-15 10:42:49 -07:00
Alexsandro
913f95b2b2
Updated github.com/btcsuite/btcd to address CVE-2024-34478
synchronize dependencies
2024-08-15 11:16:41 -03:00
Jonathan Harvey-Buschel
ee7cf5e564
wire: check TXID length before creating outpoint 2024-08-14 16:29:08 -04:00
Matt Leon
b00cec6d39 rpcclient: signet support 2024-08-13 10:15:43 -04:00
lencap
8791081be3 chore: fix some comments
Signed-off-by: lencap <techgeek@189.cn>
2024-08-09 16:51:11 +08:00
Olaoluwa Osuntokun
97400aa23e
Merge pull request #2225 from Crypt-iQ/statusbytes_08062024
blockchain: copy utxo status bytes to avoid UB
2024-08-08 18:41:45 -07:00
Eugene Siegel
3eda1a58a2
blockchain: copy utxo status bytes to avoid UB
It is undefined behavior if we directly use the value from a Get
call after the transaction has completed.
2024-08-06 11:49:23 -04:00
Olaoluwa Osuntokun
b161cd6a19
Merge pull request #2218 from guggero/btcec-fix
mod+rpcserver: bump to latest version of btcec
2024-07-23 15:46:50 -07:00
Oliver Gugger
cefeeaa6b6
mod+rpcserver: bump to latest version of btcec 2024-07-23 10:57:08 +02:00
linghuying
ff2e03e112
chore: fix some comments for struct field (#2214)
Signed-off-by: linghuying <1599935829@qq.com>
2024-07-16 09:02:23 -04:00
Olaoluwa Osuntokun
2134387ba8
Merge pull request #2208 from kcalvinalvin/2024-07-01-close-blockfiles
ffldb: close block files
2024-07-12 16:55:03 -07:00
zhiqiangxu
e5d15fddb9
btcec/ecdsa: remove error return value for SignCompact (#2211) 2024-07-10 08:43:15 -04:00
Calvin Kim
c9fae1ac7c ffldb: close block files before deleting them
The block files may be open when deleteFile is called.  This resulted in
files not being deleted and erroring out on windows.  Properly closing
the files closing the files avoids this error.
2024-07-01 22:13:22 +09:00
Calvin Kim
8ed8ef1340 ffldb: refactor out file close code into its own method
The existing file close code is refactored out into it's own method
closeFile() so that it can be reused elsewhere.
2024-07-01 22:12:32 +09:00
Calvin Kim
8b5f2aa6f2 ffldb: add check for deleting files that are open
This check let's us ensure that attempting to delete open files are
caught during unit tests.
2024-07-01 22:12:32 +09:00
Calvin Kim
4712e20049 ffldb: throw error when attempting to delete an open file
This change lets us test that we don't attempt to delete open files with
unit tests.  On Windows this behavior is not allowed which results in an
error but on linux and osx it's allowed. To better test Windows
compatibilty adding this explicit check in is useful.
2024-07-01 22:12:32 +09:00
cec489
d881c686e6
Fix the btcctl uptime command
commit 0b2998b7f279d3aef4d83415dae26948f5a6bdf4
Author: cec489 <173723251+cec489@users.noreply.github.com>
Date:   Mon Jun 24 20:01:13 2024 +0000

    A cleaner fix is to set the startTime in the server Start() function
    which is where the server is actually started.

commit ae6c1256981befb43972e83a086ea663df629873
Author: cec489 <173723251+cec489@users.noreply.github.com>
Date:   Mon Jun 24 19:15:23 2024 +0000

    Fix the btcctl uptime command by moving the setting of startupTime
2024-06-27 13:36:29 -04:00
Robert
139669066c
Sending RPC requests through unix sockets (#2168)
Sending RPC requests through unix sockets
2024-06-26 16:42:49 -04:00
Oliver Gugger
b2eec96bea
Merge pull request #2206 from guggero/psbt-serialization-fix
psbt: decode keytype as compact size
2024-06-26 03:22:32 -06:00
Yong
cc26860b40
rpcclient: update error str to match both versions (#2205)
This commit updates the error str to match the same error returned from
`btcd` for both pre-0.24.2 and post-0.24.2.
2024-06-25 10:27:44 -04:00
Oliver Gugger
4bff778564
psbt: decode keytype as compact size
Fixes #2199.

Previous to this fix the keytype was only interpreted as a single byte,
even though BIP-0174 states it is to be parsed as a CompactSize/VarInt.
2024-06-25 16:03:05 +02:00
Oliver Gugger
f6db48af5a
Merge pull request #2201 from Roasbeef/v-0-24-2
build: bump version to v0.24.2-beta
2024-06-21 02:50:01 -06:00
Olaoluwa Osuntokun
cc4b27cdd9 build: bump version to v0.24.2-beta 2024-06-20 15:35:00 -07:00
Olaoluwa Osuntokun
93e729194e
Merge pull request #2197 from Crypt-iQ/2183_eugene
main, rpcclient, integration: add rpccalls for invalidate and reconsiderblock
2024-06-20 15:28:08 -07:00
Calvin Kim
0aa80ea8f7 main: Add invalidateblock and reconsiderblock rpc commands
The rpc calls and the rpchelp is added for the invalidateblock
and reconsiderblock methods on BlockChain.
2024-06-19 19:58:37 -04:00
Calvin Kim
1cb4d3a503 rpcclient, integration: Add invalidateblock and reconsiderblock
invalidateblock and reconsiderblock are added to the rpcclient package
and an integration test is added to test the added functions.
2024-06-19 19:58:29 -04:00
Olaoluwa Osuntokun
cd5e5bab63
Merge pull request #2196 from Crypt-iQ/2181_eugene
blockchain: Add ReconsiderBlock()
2024-06-19 16:07:14 -07:00
coderwander
11bd614171
Fix struct names (#2169)
Signed-off-by: coderwander <770732124@qq.com>
2024-06-19 11:38:54 -04:00
veth
976cbebd09
chore: fix some comments (#2191) 2024-06-19 11:37:10 -04:00
yujinpark
588b2e58cf
fix: typo (#2184) 2024-06-19 11:36:16 -04:00
Calvin Kim
52a8a2a06e blockchain: Add ReconsiderBlock to BlockChain
ReconsiderBlock reconsiders the validity of the block for the passed
in blockhash. The behavior of the function mimics that of Bitcoin Core.

The invalid status of the block nodes are reset and if the chaintip that
is being reconsidered has more cumulative work, then we'll validate the
blocks and reorganize to it. If the cumulative work is lesser than the
current active chain tip, then nothing else will be done.
2024-06-07 18:08:25 -04:00
Calvin Kim
eabc9bf50c blockchain: Refactor reorganizeChain to exclude verification
reorganizeChain() used to handle the following:
1: That the blocknodes being disconnected/connected indeed to connect
   properly without errors.
2: Perform the actual disconnect/connect of the blocknodes.

The functionality of 1, the validation that the disconnects/connects can
happen without errors are now refactored out into
verifyReorganizationValidity.

This is an effort made so that ReconsiderBlock() can call
verifyReorganizationValidity and set the block status of the
reconsidered chain and return nil even when an error returns as it's ok
to get an error when reconsidering an invalid branch.
2024-06-07 18:08:25 -04:00
Oliver Gugger
de4182589b
Merge pull request #2062 from lilasxie/refactor/parsefloat
refactor: set strconv.ParseFloat bitsize to 64
2024-06-03 13:02:00 +02:00
lilasxie
cccaa5f9b0 refactor: specify strconv.ParseFloat bitsize to 64 2024-06-03 18:28:21 +08:00
Oliver Gugger
d2d286f683
Merge pull request #2186 from MarcoEzekiel/DecodeNoLimitVersioned
Added DecodeNoLimitGeneric to bech32.go
2024-05-24 08:38:32 +02:00