Block builders can only be used once, initialize at top of loop. (#3232)

This commit is contained in:
clemahieu 2021-04-25 15:25:17 +02:00 committed by GitHub
commit 20bc36f863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -65,9 +65,9 @@ TEST (network_filter, many)
nano::genesis genesis;
nano::network_filter filter (4);
nano::keypair key1;
nano::state_block_builder builder;
for (int i = 0; i < 100; ++i)
{
nano::state_block_builder builder;
auto block = builder
.account (nano::dev_genesis_key.pub)
.previous (genesis.open->hash ())

View file

@ -651,13 +651,13 @@ TEST (websocket, vote_options_representatives)
// Quick-confirm a block
nano::keypair key;
nano::state_block_builder builder;
auto balance = nano::genesis_amount;
system.wallet (0)->insert_adhoc (nano::dev_genesis_key.prv);
auto send_amount = node1->online_reps.delta () + 1;
auto confirm_block = [&] () {
nano::block_hash previous (node1->latest (nano::dev_genesis_key.pub));
balance -= send_amount;
nano::state_block_builder builder;
auto send = builder
.account (nano::dev_genesis_key.pub)
.previous (previous)