From 01a44aa2d2810c1a96c45d0f737cdebed328bb57 Mon Sep 17 00:00:00 2001 From: Peter John Bushnell Date: Mon, 14 Nov 2022 01:07:40 +0000 Subject: [PATCH] Fix CI full sync test (#1562) * Do not store live vars on failure * Revert "Update full sync CI (#1560)" This reverts commit 3b23597c5ae9d14038b65f36813641a2aa823f9f. --- .github/workflows/fullsync-tests.yml | 6 +----- ci/parallel_sync/sync_then_diff.sh | 3 --- src/masternodes/govvariables/attributes.cpp | 11 +++++++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fullsync-tests.yml b/.github/workflows/fullsync-tests.yml index 06cff80bca..2616a63119 100644 --- a/.github/workflows/fullsync-tests.yml +++ b/.github/workflows/fullsync-tests.yml @@ -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() }} diff --git a/ci/parallel_sync/sync_then_diff.sh b/ci/parallel_sync/sync_then_diff.sh index 961e5a8d07..5ad14909bd 100755 --- a/ci/parallel_sync/sync_then_diff.sh +++ b/ci/parallel_sync/sync_then_diff.sh @@ -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 diff --git a/src/masternodes/govvariables/attributes.cpp b/src/masternodes/govvariables/attributes.cpp index e1095c98d2..d513665eda 100644 --- a/src/masternodes/govvariables/attributes.cpp +++ b/src/masternodes/govvariables/attributes.cpp @@ -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) {