Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864594
D1996.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
D1996.diff
View Options
diff --git a/doc/release-notes.md b/doc/release-notes.md
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -13,3 +13,4 @@
- Improved help message for backup wallet RPC
- Various bug fixes that improve node stability and performance
- Backport getblock RPC's new verbosity mode from bitcoin core for retrieving all transactions of a given block in full.
+ - Added 'parked' state to getchaintips RPC
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -1332,13 +1332,15 @@
"Possible values for status:\n"
"1. \"invalid\" This branch contains at least one "
"invalid block\n"
- "2. \"headers-only\" Not all blocks for this branch are "
+ "2. \"parked\" This branch contains at least one "
+ "parked block\n"
+ "3. \"headers-only\" Not all blocks for this branch are "
"available, but the headers are valid\n"
- "3. \"valid-headers\" All blocks are available for this "
+ "4. \"valid-headers\" All blocks are available for this "
"branch, but they were never fully validated\n"
- "4. \"valid-fork\" This branch is not part of the "
+ "5. \"valid-fork\" This branch is not part of the "
"active chain, but is fully validated\n"
- "5. \"active\" This is the tip of the active main "
+ "6. \"active\" This is the tip of the active main "
"chain, which is certainly valid\n"
"\nExamples:\n" +
HelpExampleCli("getchaintips", "") +
@@ -1396,6 +1398,9 @@
} else if (block->nStatus.isInvalid()) {
// This block or one of its ancestors is invalid.
status = "invalid";
+ } else if (block->nStatus.isOnParkedChain()) {
+ // This block or one of its ancestors is parked.
+ status = "parked";
} else if (block->nChainTx == 0) {
// This block cannot be connected because full block data for it or
// one of its parents is missing.
diff --git a/test/functional/abc-parkedchain.py b/test/functional/abc-parkedchain.py
--- a/test/functional/abc-parkedchain.py
+++ b/test/functional/abc-parkedchain.py
@@ -74,14 +74,14 @@
good_tip = node.getbestblockhash()
node.parkblock(bad_tip)
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ self.only_valid_tip(tip, other_tip_status="parked")
node.invalidateblock(bad_tip)
# NOTE: Intuitively, other_tip_status would be "invalid", but because
# only valid (unparked) chains are walked, child blocks' statuses are
- # not updated, so the "valid-fork" state remains.
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ # not updated, so the "parked" state remains.
+ self.only_valid_tip(tip, other_tip_status="parked")
node.reconsiderblock(bad_tip)
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ self.only_valid_tip(tip, other_tip_status="parked")
node.unparkblock(bad_tip)
self.only_valid_tip(good_tip)
@@ -98,7 +98,7 @@
node.parkblock(bad_tip)
self.only_valid_tip(tip, other_tip_status="invalid")
node.reconsiderblock(bad_tip)
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ self.only_valid_tip(tip, other_tip_status="parked")
node.unparkblock(bad_tip)
self.only_valid_tip(good_tip)
@@ -111,12 +111,12 @@
good_tip = node.getbestblockhash()
node.parkblock(bad_tip)
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ self.only_valid_tip(tip, other_tip_status="parked")
node.invalidateblock(bad_tip)
# NOTE: Intuitively, other_tip_status would be "invalid", but because
# only valid (unparked) chains are walked, child blocks' statuses are
- # not updated, so the "valid-fork" state remains.
- self.only_valid_tip(tip, other_tip_status="valid-fork")
+ # not updated, so the "parked" state remains.
+ self.only_valid_tip(tip, other_tip_status="parked")
node.unparkblock(bad_tip)
self.only_valid_tip(tip, other_tip_status="invalid")
node.reconsiderblock(bad_tip)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 20:44 (14 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865911
Default Alt Text
D1996.diff (4 KB)
Attached To
D1996: Added parked state to getchaintips RPC
Event Timeline
Log In to Comment