lnwallet: prevent static fee estimator fees from being modified

Modifying the static fees is not thread safe. In this commit the fees
are made immutable.
This commit is contained in:
Joost Jager committed 2018-12-18 10:50:05 +01:00
1 parent 423dd8ab9b
commit 91f3df07e4
12 files changed
+41 -32

No files matched your search

+2 -2
View File
@@ -368,7 +368,7 @@ func createTestWallet(tempTestDir string, miningNode *rpctest.Harness,
WalletController: wc,
Signer: signer,
ChainIO: bio,
FeeEstimator: lnwallet.StaticFeeEstimator{FeePerKW: 2500},
FeeEstimator: lnwallet.NewStaticFeeEstimator(2500, 0),
DefaultConstraints: channeldb.ChannelConstraints{
DustLimit: 500,
MaxPendingAmount: lnwire.NewMSatFromSatoshis(btcutil.SatoshiPerBitcoin) * 100,
@@ -2440,7 +2440,7 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver,
}
case "neutrino":
feeEstimator = lnwallet.StaticFeeEstimator{FeePerKW: 62500}
feeEstimator = lnwallet.NewStaticFeeEstimator(62500, 0)
// Set some package-level variable to speed up
// operation for tests.