mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
Merge bitcoin/bitcoin#26194: rpc, wallet: use the same next_index key in listdescriptors and importdescriptors
b082f28101rpc, wallet: use the same `next_index` in listdescriptors and importdescriptors (w0xlt) Pull request description: Currently `listdescriptors` RPC uses `next` key to represent `WalletDescriptor::next_index` while `importdescriptors` uses `next_index`. This creates two different descriptor formats. This PR changes `listdescriptors` to use the same key as `importdescriptors`. ACKs for top commit: achow101: ACKb082f28101aureleoules: reACKb082f28101Tree-SHA512: c29ec59051878e614d749ed6dc85e5c14ad00db0e8fcbce3f5066d1aae85ef07ca70f02920299e48d191b7387024fe224b0054c4191a5951cb805106f7b8e37b
This commit is contained in:
@@ -1760,7 +1760,8 @@ RPCHelpMan listdescriptors()
|
||||
{RPCResult::Type::NUM, "", "Range start inclusive"},
|
||||
{RPCResult::Type::NUM, "", "Range end inclusive"},
|
||||
}},
|
||||
{RPCResult::Type::NUM, "next", /*optional=*/true, "The next index to generate addresses from; defined only for ranged descriptors"},
|
||||
{RPCResult::Type::NUM, "next", /*optional=*/true, "Same as next_index field. Kept for compatibility reason."},
|
||||
{RPCResult::Type::NUM, "next_index", /*optional=*/true, "The next index to generate addresses from; defined only for ranged descriptors"},
|
||||
}},
|
||||
}}
|
||||
}},
|
||||
@@ -1837,6 +1838,7 @@ RPCHelpMan listdescriptors()
|
||||
range.push_back(info.range->second - 1);
|
||||
spk.pushKV("range", range);
|
||||
spk.pushKV("next", info.next_index);
|
||||
spk.pushKV("next_index", info.next_index);
|
||||
}
|
||||
descriptors.push_back(spk);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user