Skip to content

Commit 4f0fa31

Browse files
authored
Merge pull request #475 from evoskuil/version3
Backport master/v4 commits for version3/v3.1 release.
2 parents d8fcedb + c636aa9 commit 4f0fa31

File tree

5 files changed

+8
-29
lines changed

5 files changed

+8
-29
lines changed

include/bitcoin/explorer/commands/fetch-stealth.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class BCX_API fetch_stealth
158158
(
159159
"FILTER",
160160
value<bc::config::base2>(&argument_.filter),
161-
"The Base2 stealth prefix filter used to locate transactions. Defaults to all stealth transactions."
161+
"The Base2 stealth prefix filter used to locate transactions. Must be at least 8 bits in length."
162162
);
163163

164164
return options;

include/bitcoin/explorer/commands/watch-stealth.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class BCX_API watch_stealth
157157
(
158158
"PREFIX",
159159
value<bc::config::base2>(&argument_.prefix),
160-
"The Base2 stealth prefix to watch. If not specified the prefix is read from STDIN."
160+
"The Base2 stealth prefix to watch. Must be at least 8 bits in length. If not specified the prefix is read from STDIN."
161161
);
162162

163163
return options;

include/bitcoin/explorer/utility.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ BCX_API data_chunk new_seed(size_t bit_length=minimum_seed_bits);
199199
*/
200200
BCX_API string_list numbers_to_strings(const chain::point::indexes& indexes);
201201

202-
/**
203-
* DEPRECATED in favor of libbitcoin::pseudo_random_fill.
204-
* Fill a buffer with randomness using the default random engine.
205-
* @param[in] chunk The buffer to fill with randomness.
206-
*/
207-
BCX_API void random_fill(data_chunk& chunk);
208-
209202
/**
210203
* Get a message from the specified input stream.
211204
* @param[in] stream The input stream to read.

model/generate.xml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@
255255
<define name="BX_EK_TO_EC_INVALID_PASSPHRASE" value="The passphrase is incorrect." />
256256
<define name="BX_EK_TO_EC_REQUIRES_ICU" value="The command requires an ICU build." />
257257
</command>
258-
259-
<!-- TODO: document no unconfirmed history for 3.0 [done] -->
258+
260259
<command symbol="fetch-balance" output="balance_row" category="ONLINE" network="true" description="Get the balance in satoshi of a payment address. Requires a Libbitcoin server connection.">
261260
<option name="format" type="encoding" description="The output format. Options are 'info', 'json' and 'xml', defaults to 'info'." />
262261
<argument name="PAYMENT_ADDRESS" stdin="true" type="payment_address" description="The payment address. If not specified the address is read from STDIN." />
@@ -268,13 +267,11 @@
268267
<option name="height" shortcut="t" type="uint32_t" description="The block height."/>
269268
</command>
270269

271-
<!-- TODO: document new public-key argument for 3.1 -->
272270
<command symbol="fetch-height" formerly="fetch-last-height" output="uint32_t" category="ONLINE" network="true" description="Get the last block height. Requires a Libbitcoin server connection.">
273271
<argument name="server-url" description="The URL of the Libbitcoin server to use. If not specified the URL is obtained from configuration settings or defaults."/>
274272
<argument name="public-key" description="The public key of the Libbitcoin server. If not specified the key is obtained from configuration settings or defaults."/>
275273
</command>
276-
277-
<!-- TODO: document simplified output format (3.1) and no unconfirmed history for 3.0 [done] -->
274+
278275
<command symbol="fetch-history" output="history_row" category="ONLINE" network="true" description="Get list of output points, values, and spends for a payment address. Requires a Libbitcoin server connection.">
279276
<option name="format" type="encoding" description="The output format. Options are 'info', 'json' and 'xml', defaults to 'info'." />
280277
<argument name="PAYMENT_ADDRESS" stdin="true" type="payment_address" description="The payment address. If not specified the address is read from STDIN." />
@@ -285,13 +282,12 @@
285282
<define name="BX_FETCH_PUBLIC_KEY_NOT_IMPLEMENTED" value="This command is not yet implemented." />
286283
</command>
287284

288-
<!-- TODO: document new limit (8 bit filter) for 3.1 -->
289285
<command symbol="fetch-stealth" output="stealth_row" category="ONLINE" network="true" description="Get metadata on potential payment transactions by stealth prefix filter. Requires a Libbitcoin server connection.">
290286
<option name="format" type="encoding" description="The output format. Options are 'info', 'json' and 'xml', defaults to 'info'." />
291287
<option name="height" shortcut="t" type="uint32_t" description="The minimum block height of transactions to include."/>
292288
<!--<option name="scan_secret" type="ec_private" description="The Base16 EC private key to use locally in confirming stealth transactions."/>-->
293289
<!--<option name="scan_pubkey" shortcut="p" type="ec_public" description="The Base16 EC public key to use locally in confirming stealth transactions."/>-->
294-
<argument name="FILTER" type="base2" description="The Base2 stealth prefix filter used to locate transactions. Defaults to all stealth transactions." />
290+
<argument name="FILTER" type="base2" description="The Base2 stealth prefix filter used to locate transactions. Must be at least 8 bits in length." />
295291
<define name="BX_FETCH_STEALTH_PREFIX_TOO_LONG" value="Stealth prefix is limited to 32 bits." />
296292
<define name="BX_FETCH_STEALTH_FILTER_TOO_SHORT" value="Stealth prefix must be at least 8 bits." />
297293
</command>
@@ -407,8 +403,7 @@
407403
<command symbol="mnemonic-encode" formerly="mnemonic" output="string" multipleX="true" category="ELECTRUM" obsolete="true" description="Convert an Electrum mnemonic to its seed.">
408404
<define name="BX_MNEMONIC_ENCODE_OBSOLETE" value="Electrum style key functions are obsolete. Use mnemonic-new (BIP39) command instead." />
409405
</command>
410-
411-
<!-- TODO: update online documentation for 3.x release additional languages ('cs', 'ru', 'uk'). -->
406+
412407
<command symbol="mnemonic-new" output="string" multipleX="true" category="WALLET" description="Create a mnemonic seed (BIP39) from entropy. WARNING: mnemonic should be created from properly generated entropy.">
413408
<option name="language" type="language" description="The language identifier of the mnemonic dictionary to use. Options are 'en', 'es', 'fr', 'it', 'ja', 'cs', 'ru', 'uk', 'zh_Hans', 'zh_Hant' and 'any', defaults to 'en'." />
414409
<argument name="SEED" stdin="true" type="base16" description="The Base16 entropy from which the mnemonic is created. The length must be evenly divisible by 32 bits. If not specified the entropy is read from STDIN." />
@@ -586,21 +581,19 @@
586581
<define name="BX_VALIDATE_TX_INVALID" value="The transaction is invalid for the current state of the node: %1%." />
587582
</command>
588583

589-
<!-- TODO: document no format and no stealth for 3.1 release. -->
590584
<command symbol="watch-address" formerly="monitor" output="transaction" category="ONLINE" network="true" description="Watch the network for transactions in which an address participates. Requires a Libbitcoin server connection.">
591585
<option name="duration" type="uint32_t" default="600" description="The duration of the watch in seconds, defaults to 600." />
592586
<!--<option name="format" type="encoding" description="The output format. Options are 'info', 'json' and 'xml', defaults to 'info'." />-->
593587
<argument name="PAYMENT_ADDRESS" stdin="true" type="payment_address" description="The participating payment address. If not specified the address is read from STDIN." />
594588
<define name="BX_WATCH_ADDRESS_WAITING" value="Watching address: %1%..." />
595589
</command>
596590

597-
<!-- TODO: document new command and no format for 3.1 release. -->
598591
<command symbol="watch-stealth" output="transaction" category="ONLINE" network="true" description="Watch the network for transactions by stealth prefix. Requires a Libbitcoin server connection.">
599592
<option name="duration" type="uint32_t" default="600" description="The duration of the watch in seconds, defaults to 600." />
600593
<!--<option name="format" type="encoding" description="The output format. Options are 'info', 'json' and 'xml', defaults to 'info'." />-->
601594
<!--<option name="scan_secret" type="ec_private" description="The Base16 EC private key to use locally in confirming stealth transactions."/>-->
602595
<!--<option name="scan_pubkey" shortcut="p" type="ec_public" description="The Base16 EC public key to use locally in confirming stealth transactions."/>-->
603-
<argument name="PREFIX" stdin="true" type="base2" description="The Base2 stealth prefix to watch. If not specified the prefix is read from STDIN." />
596+
<argument name="PREFIX" stdin="true" type="base2" description="The Base2 stealth prefix to watch. Must be at least 8 bits in length. If not specified the prefix is read from STDIN." />
604597
<define name="BX_WATCH_STEALTH_PREFIX_WAITING" value="Watching stealth prefix: %1%..." />
605598
<define name="BX_WATCH_STEALTH_PREFIX_TOO_LONG" value="Stealth prefix is limited to 32 bits." />
606599
<define name="BX_WATCH_STEALTH_PREFIX_TOO_SHORT" value="Stealth prefix must be at least 8 bits." />

src/utility.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ data_chunk new_seed(size_t bit_length)
7676
{
7777
size_t fill_seed_size = bit_length / byte_bits;
7878
data_chunk seed(fill_seed_size);
79-
random_fill(seed);
79+
pseudo_random_fill(seed);
8080
return seed;
8181
}
8282

@@ -90,13 +90,6 @@ string_list numbers_to_strings(const chain::point::indexes& indexes)
9090
return stringlist;
9191
}
9292

93-
// Not testable due to lack of random engine injection.
94-
// DEPRECATED in favor of libbitcoin::pseudo_random_fill.
95-
void random_fill(data_chunk& chunk)
96-
{
97-
pseudo_random_fill(chunk);
98-
}
99-
10093
// TODO: switch to binary for raw (primitive) reads in windows.
10194
std::string read_stream(std::istream& stream)
10295
{

0 commit comments

Comments
 (0)