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

Fix full sync issues #1562

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .github/workflows/fullsync-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ jobs:
- name: Sync and Diff
run: ./sync_then_diff.sh

- name: Show debug.log
- name: Show Debug Log
run: cat $DATADIR/debug.log
if: ${{ failure() || success() }}

- name: Show log file
run: cat $DATADIR/debug-tmp-$STOP_BLOCK.log
if: ${{ failure() || success() }}
3 changes: 0 additions & 3 deletions ci/parallel_sync/sync_then_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ main() {
CUR_BLOCK=$($DEFI_CLI_CMD getblockcount || echo $BLOCK)
if [ "$CUR_BLOCK" -eq "$BLOCK" ]; then
ATTEMPTS=$((ATTEMPTS + 1))

# Handle odd case where node get stuck on previously invalidated block
$DEFI_CLI_CMD reconsiderblock $($DEFI_CLI_CMD getbestblockhash)
else
ATTEMPTS=0
fi
Expand Down
11 changes: 7 additions & 4 deletions src/masternodes/govvariables/attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,13 +658,16 @@ static void TrackLiveBalance(CCustomCSView& mnview, const CTokenAmount& amount,
assert(attributes);
CDataStructureV0 key{AttributeTypes::Live, ParamIDs::Economy, dataKey};
auto balances = attributes->GetValue(key, CBalances{});
Res res{};
if (add) {
balances.Add(amount);
res = balances.Add(amount);
} else {
balances.Sub(amount);
res = balances.Sub(amount);
}
if (res) {
attributes->SetValue(key, balances);
mnview.SetVariable(*attributes);
}
attributes->SetValue(key, balances);
mnview.SetVariable(*attributes);
}

void TrackNegativeInterest(CCustomCSView& mnview, const CTokenAmount& amount) {
Expand Down