Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hive #3626

Closed
wants to merge 51 commits into from
Closed

Hive #3626

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
dbcdd7d
Add posting_json_metadata to condenser_api account_object #3507
mvandeberg Sep 12, 2019
0c5da8e
[BW]: Changed STEEM and SBD coin names in the legacy_asset implementa…
vogel76 Mar 16, 2020
ab1d2d4
Merge branch 'STEEM_SBD_symbols_rename' into '0.23.0'
vogel76 Mar 16, 2020
74177d3
Remove all delegations and steem/sp/sbd from steemit accounts
drov0 Mar 8, 2020
1bcf56a
transfer escrow, savings to dao. remove pending curation and posting …
drov0 Mar 9, 2020
9840b83
Added support for rewards along with global supply
drov0 Mar 12, 2020
e9f2f73
hardfork vop
drov0 Mar 13, 2020
1b421e7
[BW]: Added possibility to specify hardfork time through env. variabl…
vogel76 Mar 14, 2020
39db349
[BW]: [NIP] Implemented storage for transaction_id inxed in AH-rocksd…
vogel76 Mar 17, 2020
cb9c6f3
Merge branch 'rocksb_ah_supplement_rebase_0_23_0' into '0.23.0'
vogel76 Mar 17, 2020
0d662f1
Added escrows to as target as well and fixed vests withdrawal issues
drov0 Mar 17, 2020
37b4356
STEEM and SBD rename supplement:
vogel76 Mar 18, 2020
fd3f488
Merge branch 'STEEM_SBD_rename_supplement' into '0.23.0'
vogel76 Mar 18, 2020
a368be4
[ABW]: [Fix] wrong balance affected when removing savings
Mar 18, 2020
a341ce4
[ABW]: [Fix] it should already be at zero and if it wasn't making it …
Mar 18, 2020
9a3a42d
[ABW]: [Fix] reward_vesting_steem is STEEM, not VESTS; also duplicate…
Mar 18, 2020
074bd53
[ABW]: [Fix] no need to break historical record of the account
Mar 18, 2020
3d096d9
[ABW]: [Fix] looking for 'to' would require different index that does…
Mar 18, 2020
eeabcc7
[ABW]: [Fix] missing clearing of open limit orders
Mar 18, 2020
1a84fdc
[ABW]: [Fix] missing clearing of pending convert requests
Mar 18, 2020
6b4a2aa
[ABW]: [Ign] minor tweak
Mar 18, 2020
24d2be4
[ABW]: [Fix] gpo.total_vesting_shares and gpo.total_vesting_fund_stee…
Mar 18, 2020
3a7d480
[ABW]: [Fix] mix of claim_reward_balance_operation and conversion fro…
Mar 18, 2020
64d6e88
[ABW]: [Fix] unused variable and related code removed; unnecessary op…
Mar 18, 2020
d1aba59
[ABW]: [Fix] wrong index used - needs two separate runs for 'from' an…
Mar 18, 2020
b6f4d1f
[ABW]: [Ign] formatting
Mar 18, 2020
929b67d
[ABW]: [Fix] missing handling of expired delegation objects; also loo…
Mar 18, 2020
d0bc5c2
Reset TAPOS buffer to avoid replay attack
Mar 18, 2020
3c76163
init default values for SBD asset with proper symbol
netuoso Mar 19, 2020
713fdc6
[ABW]: [Ign] code for HF23 moved to separate routine for easier testing
Mar 19, 2020
60e81a3
First HF unit-test - doesn't work
Mariusz-Trela Mar 19, 2020
d01fc9d
[BW]: HF23 time can be specified via env. variable also for MainNet\n…
vogel76 Mar 19, 2020
c67c866
Merge branch 'ninja_mine_to_dao_0_23_rebase' of gitlab.syncad.com:hiv…
vogel76 Mar 19, 2020
03478f6
The simplest unit-test works
Mariusz-Trela Mar 19, 2020
ef8828e
Merge branch 'condenser-api-fix' into '0.23.0'
vogel76 Mar 19, 2020
3cb9b67
Voting + delegations - unit-tests part 1
Mariusz-Trela Mar 19, 2020
8b2ba15
Voting + delegations - unit-tests part 2
Mariusz-Trela Mar 19, 2020
8af3535
Merge branch 'ninja_mine_to_dao_0_23_rebase' into '0.23.0'
vogel76 Mar 19, 2020
1e20d71
Merge branch 'reset_tapos_buffer' into '0.23.0'
vogel76 Mar 19, 2020
5027f29
[BW]: [HF23 time set to Friday, 20 March 2020 14:00:00 GMT
vogel76 Mar 19, 2020
98ff1a5
[BW]: Fixed compile failure in TEST_NET build
vogel76 Mar 19, 2020
ad3414d
Signal HF23 sooner
Mar 19, 2020
4fe70ee
changed Steem Network to Hive NW and added ASCII logo
roelandp Mar 19, 2020
d3856bc
Merge branch 'hf23-signal' into '0.23.0'
vogel76 Mar 19, 2020
fcf7491
Exclude accounts who voted a minimum of two sockpuppets and who didn'…
drov0 Mar 20, 2020
2b8f66f
remove last comma
drov0 Mar 20, 2020
9c47287
removed duplicated
drov0 Mar 20, 2020
941f250
Merge branch 'exclude-list-update' into '0.23.0'
vogel76 Mar 20, 2020
86ec9f1
added sockpuppets
drov0 Mar 20, 2020
bc73e54
Merge branch 'excluded-socks-v2' into '0.23.0'
vogel76 Mar 20, 2020
1a9f9b8
Hive diff
jnordberg Mar 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions libraries/chain/block_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,60 @@ namespace steem { namespace chain {
}
}

void block_log::rewrite(const fc::path& inputFile, const fc::path& outputFile, uint32_t maxBlockNo)
{
if(my->block_stream.is_open())
my->block_stream.close();
if(my->index_stream.is_open())
my->index_stream.close();
my->index_write = false;
my->block_file = inputFile;

my->block_stream.open(my->block_file.generic_string().c_str(), LOG_READ);
my->block_write = false;

std::fstream outFile;

outFile.exceptions(std::fstream::failbit | std::fstream::badbit);
outFile.open(outputFile.generic_string().c_str(), LOG_WRITE);

uint64_t pos = 0;
uint64_t end_pos = 0;

my->block_stream.seekg(-sizeof(uint64_t), std::ios::end);
my->block_stream.read((char*)&end_pos, sizeof(end_pos));
signed_block tmp;

my->block_stream.seekg(pos);

uint32_t blockNo = 0;

while(pos < end_pos)
{
fc::raw::unpack(my->block_stream, tmp);
my->block_stream.read((char*)&pos, sizeof(pos));

uint64_t outPos = outFile.tellp();

if(outPos != pos)
{
ilog("Block position mismatch");
}

auto data = fc::raw::pack_to_vector(tmp);
outFile.write(data.data(), data.size());
outFile.write((char*)&outPos, sizeof(outPos));

if(++blockNo >= maxBlockNo)
break;

if(blockNo % 1000 == 0)
printf("Rewritten block: %u\r", blockNo);
}

outFile.close();
}

void block_log::close()
{
my.reset( new detail::block_log_impl() );
Expand Down Expand Up @@ -374,6 +428,12 @@ namespace steem { namespace chain {
my->block_stream.read( (char*)&pos, sizeof( pos ) );
my->index_stream.write( (char*)&pos, sizeof( pos ) );
}

/// Flush and reopen to be sure that given index file has been saved.
/// Otherwise just executed replay, next stopped by ctrl+C can again corrupt this file.
my->index_stream.flush();
my->index_stream.close();
my->index_stream.open(my->index_file.generic_string().c_str(), LOG_WRITE);
}
FC_LOG_AND_RETHROW()
}
Expand Down
Loading