Skip to content

Commit

Permalink
Add satoshi's words to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Mar 9, 2017
1 parent 66d6ead commit ea15e9a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ BC_USE_LIBBITCOIN_MAIN
// Testing out our http://utf8everywhere.org implementation.
int bc::main(int argc, char* argv[])
{
// Windows utf8 everywhere demonstration.
set_utf8_stdio();

bc::cout << "output : acción.кошка.日本国" << std::endl;
Expand All @@ -43,5 +44,13 @@ int bc::main(int argc, char* argv[])
bc::cout << "environ[0] : " << environ[0] << std::endl;
#endif

// Extracting Satoshi's words.
const auto block = bc::chain::block::genesis_mainnet();
const auto& tx = block.transactions().front();
const auto& input = tx.inputs().front();
const auto script = input.script().to_data(false);
std::string message(script.begin() + sizeof(uint64_t), script.end());
bc::cout << message << std::endl;

return EXIT_SUCCESS;
}

0 comments on commit ea15e9a

Please sign in to comment.