aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-07-02 16:51:07 -0400
committerAva Chow <github@achow101.com>2024-07-02 16:51:07 -0400
commit74d61151e50802502b9bf7bcc6bf97ea4cb86457 (patch)
tree9385363755fa0d396e04581b95d161ce6d3d6d55
parentbe63674c182ed007c902d3004d0a17f34f8b2ece (diff)
parent7d55796c530f891493302059c6200d4a606c1ca9 (diff)
Merge bitcoin/bitcoin#30365: #27307 follow-up: update mempool conflict tests + docs
7d55796c530f891493302059c6200d4a606c1ca9 wallet: update mempool conflicts tests + docs (ishaanam) Pull request description: #27307 follow-up: - updates description of `mempoolconflicts` and `walletconflicts` in `gettransaction` - adds release notes for 27307 - removes unnecessary line from `wallet_conflicts.py` ACKs for top commit: fjahr: ACK 7d55796c530f891493302059c6200d4a606c1ca9 achow101: ACK 7d55796c530f891493302059c6200d4a606c1ca9 furszy: utACK 7d55796c530 tdb3: ACK 7d55796c530f891493302059c6200d4a606c1ca9 Tree-SHA512: b3c368c7072cacdaf5fd18ecb0a88ab76ce02f65d56fce55a3316afa0989b9417c31e563aa8d9dd8f6294add154b4fdeb4ada5081c6b8a5fe9953f0e8a4812f4
-rw-r--r--doc/release-notes-27307.md8
-rw-r--r--src/wallet/rpc/transactions.cpp4
-rwxr-xr-xtest/functional/wallet_conflicts.py2
3 files changed, 10 insertions, 4 deletions
diff --git a/doc/release-notes-27307.md b/doc/release-notes-27307.md
new file mode 100644
index 0000000000..58fc7098b5
--- /dev/null
+++ b/doc/release-notes-27307.md
@@ -0,0 +1,8 @@
+Wallet
+---
+
+The wallet now detects when wallet transactions conflict with the mempool. Mempool
+conflicting transactions can be seen in the `"mempoolconflicts"` field of
+`gettransaction`. The inputs of mempool conflicted transactions can now be respent
+without manually abandoning the transactions when the parent transaction is dropped
+from the mempool, which can cause wallet balances to appear higher.
diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp
index 5abc983701..0dacfa808b 100644
--- a/src/wallet/rpc/transactions.cpp
+++ b/src/wallet/rpc/transactions.cpp
@@ -415,13 +415,13 @@ static std::vector<RPCResult> TransactionDescriptionString()
{RPCResult::Type::NUM_TIME, "blocktime", /*optional=*/true, "The block time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id."},
{RPCResult::Type::STR_HEX, "wtxid", "The hash of serialized transaction, including witness data."},
- {RPCResult::Type::ARR, "walletconflicts", "Conflicting transaction ids.",
+ {RPCResult::Type::ARR, "walletconflicts", "Confirmed transactions that have been detected by the wallet to conflict with this transaction.",
{
{RPCResult::Type::STR_HEX, "txid", "The transaction id."},
}},
{RPCResult::Type::STR_HEX, "replaced_by_txid", /*optional=*/true, "Only if 'category' is 'send'. The txid if this tx was replaced."},
{RPCResult::Type::STR_HEX, "replaces_txid", /*optional=*/true, "Only if 'category' is 'send'. The txid if this tx replaces another."},
- {RPCResult::Type::ARR, "mempoolconflicts", "Transactions that directly conflict with either this transaction or an ancestor transaction",
+ {RPCResult::Type::ARR, "mempoolconflicts", "Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction",
{
{RPCResult::Type::STR_HEX, "txid", "The transaction id."},
}},
diff --git a/test/functional/wallet_conflicts.py b/test/functional/wallet_conflicts.py
index e5739a6a59..25a95aa954 100755
--- a/test/functional/wallet_conflicts.py
+++ b/test/functional/wallet_conflicts.py
@@ -9,7 +9,6 @@ Test that wallet correctly tracks transactions that have been conflicted by bloc
from decimal import Decimal
-from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
@@ -37,7 +36,6 @@ class TxConflicts(BitcoinTestFramework):
"""
self.test_block_conflicts()
- self.generatetoaddress(self.nodes[0], COINBASE_MATURITY + 7, self.nodes[2].getnewaddress())
self.test_mempool_conflict()
self.test_mempool_and_block_conflicts()
self.test_descendants_with_mempool_conflicts()