Skip to content

Commit

Permalink
Add testnet option
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinandresen committed Dec 11, 2012
1 parent 4b96b60 commit d577249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paymentrequest-create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ string x509_to_der(X509 *cert) {

int main(int argc, char **argv) {
std::list<string> expected = split("paytoaddress,amount,certificates,privatekey,memo,"
"expires,receipt_url,single_use,out", ",");
"expires,receipt_url,single_use,out,testnet,testnet3", ",");

map<string,string> params;
if (!parse_command_line(argc, argv, expected, params)) {
Expand Down Expand Up @@ -92,6 +92,8 @@ int main(int argc, char **argv) {
paymentRequest.set_time(time(0));
paymentRequest.set_expires(time(0)+60*60*24);
paymentRequest.set_single_use(true);
if (params.count("testnet") || params.count("testnet3"))
paymentRequest.set_network("testnet3");

// Output to Bitcoin Foundation donation address, using standard pay-to-pubkey-hash script:
// Foundation address is 1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW which is
Expand Down

0 comments on commit d577249

Please sign in to comment.