Skip to content

Commit f435710

Browse files
committed
Resolve guix non-determinism with emplace_back instead of push_back
For some reason, building x86_64-w64-mingw32 on x86_64 and aarch64 results in a single instruction difference which can be traced down to prevector.h:174. The ultimate caller of this is the copy constructor for a prevector that ends up being called by std::vector::push_back in walletmodel.cpp:183. By replacing the push_back with an emplace_back, somehow this non-determinism goes away.
1 parent b7e9dc8 commit f435710

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/qt/walletmodel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
179179
setAddress.insert(rcp.address);
180180
++nAddresses;
181181

182-
CRecipient recipient{DecodeDestination(rcp.address.toStdString()), rcp.amount, rcp.fSubtractFeeFromAmount};
183-
vecSend.push_back(recipient);
182+
vecSend.emplace_back(CRecipient{DecodeDestination(rcp.address.toStdString()), rcp.amount, rcp.fSubtractFeeFromAmount});
184183

185184
total += rcp.amount;
186185
}

0 commit comments

Comments
 (0)