code/satoshi-words: save_script, use const.

pull/201/head
Will Binns 8 years ago
parent c75c75ea14
commit 3e863bcf9c
No known key found for this signature in database
GPG Key ID: 302EBEAEEB74A404

@ -7,7 +7,7 @@
int main()
{
// Create genesis block.
bc::block_type block = bc::genesis_block();
const bc::block_type block = bc::genesis_block();
// Genesis block contains a single coinbase transaction.
assert(block.transactions.size() == 1);
// Get first transaction in block (coinbase).
@ -16,7 +16,7 @@ int main()
assert(coinbase_tx.inputs.size() == 1);
const bc::transaction_input_type& coinbase_input = coinbase_tx.inputs[0];
// Convert the input script to its raw format.
const bc::data_chunk& raw_message = save_script(coinbase_input.script);
const bc::data_chunk raw_message = save_script(coinbase_input.script);
// Convert this to an std::string.
std::string message;
message.resize(raw_message.size());
@ -25,4 +25,3 @@ int main()
std::cout << message << std::endl;
return 0;
}

Loading…
Cancel
Save