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:
12 files changed
+41
-32
No files matched your search
@@ -1336,7 +1336,7 @@ func createTestArbiter(t *testing.T, contractBreaches chan *ContractBreachEvent,
|
||||
ba := newBreachArbiter(&BreachConfig{
|
||||
CloseLink: func(_ *wire.OutPoint, _ htlcswitch.ChannelCloseType) {},
|
||||
DB: db,
|
||||
Estimator: &lnwallet.StaticFeeEstimator{FeePerKW: 12500},
|
||||
Estimator: lnwallet.NewStaticFeeEstimator(12500, 0),
|
||||
GenSweepScript: func() ([]byte, error) { return nil, nil },
|
||||
ContractBreaches: contractBreaches,
|
||||
Signer: signer,
|
||||
@@ -1476,7 +1476,7 @@ func createInitChannels(revocationWindow int) (*lnwallet.LightningChannel, *lnwa
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
estimator := &lnwallet.StaticFeeEstimator{FeePerKW: 12500}
|
||||
estimator := lnwallet.NewStaticFeeEstimator(12500, 0)
|
||||
feePerKw, err := estimator.EstimateFeePerKW(1)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
|
||||
Reference in new issue
Block a user