mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: apply the new type lntypes.WeightUnit
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/watchtower/blob"
|
||||
"github.com/lightningnetwork/lnd/watchtower/wtdb"
|
||||
)
|
||||
@@ -123,7 +124,7 @@ func (p *JusticeDescriptor) commitToRemoteInput() (*breachedInput, error) {
|
||||
// assembleJusticeTxn accepts the breached inputs recovered from state update
|
||||
// and attempts to construct the justice transaction that sweeps the victims
|
||||
// funds to their wallet and claims the watchtower's reward.
|
||||
func (p *JusticeDescriptor) assembleJusticeTxn(txWeight int64,
|
||||
func (p *JusticeDescriptor) assembleJusticeTxn(txWeight lntypes.WeightUnit,
|
||||
inputs ...*breachedInput) (*wire.MsgTx, error) {
|
||||
|
||||
justiceTxn := wire.NewMsgTx(2)
|
||||
@@ -287,7 +288,7 @@ func (p *JusticeDescriptor) CreateJusticeTxn() (*wire.MsgTx, error) {
|
||||
|
||||
// TODO(conner): sweep htlc outputs
|
||||
|
||||
txWeight := int64(weightEstimate.Weight())
|
||||
txWeight := weightEstimate.Weight()
|
||||
|
||||
return p.assembleJusticeTxn(txWeight, sweepInputs...)
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ func testJusticeDescriptor(t *testing.T, blobType blob.Type) {
|
||||
}
|
||||
|
||||
outputs, err := policy.ComputeJusticeTxOuts(
|
||||
totalAmount, int64(txWeight), justiceKit.SweepAddress(),
|
||||
totalAmount, txWeight, justiceKit.SweepAddress(),
|
||||
sessionInfo.RewardAddress,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user