Advertisement
tamjan

circular-for-cln-v23.05.patch

Jun 8th, 2023 (edited)
1,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 24.73 KB | None | 0 0
  1. diff --git a/go.mod b/go.mod
  2. index 0f5ab87..aa2918a 100644
  3. --- a/go.mod
  4. +++ b/go.mod
  5. @@ -1,21 +1,20 @@
  6.  module circular
  7.  
  8. -go 1.18
  9. +go 1.20
  10.  
  11.  require (
  12. -   github.com/dgraph-io/badger/v3 v3.2103.2
  13. -   github.com/elementsproject/glightning v0.0.0-20220502095901-74f998c51367
  14. -   github.com/gammazero/deque v0.2.0
  15. +   github.com/dgraph-io/badger/v4 v4.1.0
  16. +   github.com/elementsproject/glightning v0.0.0-20230525134205-ef34d849f564
  17. +   github.com/gammazero/deque v0.2.1
  18.     github.com/robfig/cron/v3 v3.0.1
  19. -   github.com/stretchr/testify v1.7.0
  20. +   github.com/stretchr/testify v1.8.4
  21.     github.com/virtuald/go-paniclog v0.0.0-20190812204905-43a7fa316459
  22.  )
  23.  
  24.  require (
  25. -   github.com/cespare/xxhash v1.1.0 // indirect
  26. -   github.com/cespare/xxhash/v2 v2.1.1 // indirect
  27. +   github.com/cespare/xxhash/v2 v2.1.2 // indirect
  28.     github.com/davecgh/go-spew v1.1.1 // indirect
  29. -   github.com/dgraph-io/ristretto v0.1.0 // indirect
  30. +   github.com/dgraph-io/ristretto v0.1.1 // indirect
  31.     github.com/dustin/go-humanize v1.0.0 // indirect
  32.     github.com/gogo/protobuf v1.3.2 // indirect
  33.     github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
  34. @@ -24,10 +23,11 @@ require (
  35.     github.com/golang/snappy v0.0.3 // indirect
  36.     github.com/google/flatbuffers v1.12.1 // indirect
  37.     github.com/klauspost/compress v1.12.3 // indirect
  38. +   github.com/kr/text v0.2.0 // indirect
  39.     github.com/pkg/errors v0.9.1 // indirect
  40.     github.com/pmezard/go-difflib v1.0.0 // indirect
  41.     go.opencensus.io v0.22.5 // indirect
  42. -   golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
  43. -   golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
  44. -   gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
  45. +   golang.org/x/net v0.7.0 // indirect
  46. +   golang.org/x/sys v0.5.0 // indirect
  47. +   gopkg.in/yaml.v3 v3.0.1 // indirect
  48.  )
  49. diff --git a/go.sum b/go.sum
  50. index c7103d0..5ee736c 100644
  51. --- a/go.sum
  52. +++ b/go.sum
  53. @@ -1,33 +1,25 @@
  54.  cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
  55.  github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
  56. -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
  57. -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
  58. -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
  59. -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
  60. -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
  61. -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
  62.  github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
  63. +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
  64. +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
  65.  github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
  66. -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
  67. -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
  68. -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
  69. -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
  70. +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
  71.  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  72.  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
  73.  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  74. -github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8=
  75. -github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M=
  76. -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI=
  77. -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug=
  78. +github.com/dgraph-io/badger/v4 v4.1.0 h1:E38jc0f+RATYrycSUf9LMv/t47XAy+3CApyYSq4APOQ=
  79. +github.com/dgraph-io/badger/v4 v4.1.0/go.mod h1:P50u28d39ibBRmIJuQC/NSdBOg46HnHw7al2SW5QRHg=
  80. +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
  81. +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
  82.  github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
  83.  github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
  84.  github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
  85.  github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
  86. -github.com/elementsproject/glightning v0.0.0-20220502095901-74f998c51367 h1:q1fJg4S6S+ZMBC5STPZPLCQU4tvIq17/7ZEmKO/4bVU=
  87. -github.com/elementsproject/glightning v0.0.0-20220502095901-74f998c51367/go.mod h1:YAdIeSyx8VEhDCtEaGOJLmWNpPaQ3x4vYSAj9Vrppdo=
  88. -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
  89. -github.com/gammazero/deque v0.2.0 h1:SkieyNB4bg2/uZZLxvya0Pq6diUlwx7m2TeT7GAIWaA=
  90. -github.com/gammazero/deque v0.2.0/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU=
  91. +github.com/elementsproject/glightning v0.0.0-20230525134205-ef34d849f564 h1:orSb6yU9D1Ow9epbRZJVAfGF6vC1HxaPqg9zLWga6Hw=
  92. +github.com/elementsproject/glightning v0.0.0-20230525134205-ef34d849f564/go.mod h1:YAdIeSyx8VEhDCtEaGOJLmWNpPaQ3x4vYSAj9Vrppdo=
  93. +github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0=
  94. +github.com/gammazero/deque v0.2.1/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU=
  95.  github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
  96.  github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
  97.  github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
  98. @@ -43,52 +35,30 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
  99.  github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw=
  100.  github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
  101.  github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  102. -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  103. -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
  104. -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
  105.  github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
  106.  github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
  107.  github.com/klauspost/compress v1.12.3 h1:G5AfA94pHPysR56qqrkO2pxEexdDzrpFJ6yt/VqWxVU=
  108.  github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
  109.  github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
  110. -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
  111. -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
  112. -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
  113. -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
  114. -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
  115. -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
  116. -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
  117. -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
  118. +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
  119. +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
  120.  github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
  121.  github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  122.  github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
  123.  github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
  124.  github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
  125.  github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
  126. -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
  127. -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
  128. -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
  129. -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
  130. -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
  131. -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
  132. -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
  133. -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
  134. -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
  135. -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
  136.  github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  137. -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
  138.  github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
  139. -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
  140.  github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  141. -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
  142. +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
  143. +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
  144.  github.com/virtuald/go-paniclog v0.0.0-20190812204905-43a7fa316459 h1:x9pIfbdIjnw+Ylb2vE27Gtqb7BDmfR+nLcJwvbJh98U=
  145.  github.com/virtuald/go-paniclog v0.0.0-20190812204905-43a7fa316459/go.mod h1:nFvuG3SWu3VWqobG3cX8nt57wXU0OOFapeCs/8axIuM=
  146. -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
  147.  github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  148.  github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  149.  go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0=
  150.  go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
  151. -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  152.  golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
  153.  golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  154.  golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  155. @@ -105,8 +75,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
  156.  golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  157.  golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  158.  golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  159. -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
  160.  golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  161. +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
  162. +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
  163.  golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
  164.  golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  165.  golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  166. @@ -115,13 +86,13 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
  167.  golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  168.  golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  169.  golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  170. -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  171.  golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  172.  golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  173.  golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  174.  golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  175. -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
  176. -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  177. +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
  178. +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
  179. +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
  180.  golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  181.  golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  182.  golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  183. @@ -143,8 +114,8 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi
  184.  google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
  185.  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  186.  gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
  187. -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  188.  gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  189. -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
  190.  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  191. +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
  192. +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  193.  honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  194. diff --git a/graph/channel.go b/graph/channel.go
  195. index 7fdba6c..d492e30 100644
  196. --- a/graph/channel.go
  197. +++ b/graph/channel.go
  198. @@ -2,8 +2,6 @@ package graph
  199.  
  200.  import (
  201.     "github.com/elementsproject/glightning/glightning"
  202. -   "strconv"
  203. -   "strings"
  204.     "time"
  205.  )
  206.  
  207. @@ -11,19 +9,17 @@ type Channel struct {
  208.     *glightning.Channel `json:"channel"`
  209.     Liquidity           uint64 `json:"liquidity"`
  210.     Timestamp           int64  `json:"timestamp"`
  211. -   maxHtlcMsat         uint64 `json:"-"`
  212. -   minHtlcMsat         uint64 `json:"-"`
  213. +   maxHtlcMsat         uint64
  214. +   minHtlcMsat         uint64
  215.  }
  216.  
  217.  func NewChannel(channel *glightning.Channel, liquidity uint64, timestamp int64) *Channel {
  218. -   maxHtlcMsat, _ := strconv.ParseUint(strings.TrimSuffix(channel.HtlcMaximumMilliSatoshis, "msat"), 10, 64)
  219. -   minHtlcMsat, _ := strconv.ParseUint(strings.TrimSuffix(channel.HtlcMinimumMilliSatoshis, "msat"), 10, 64)
  220.     return &Channel{
  221.         Channel:     channel,
  222.         Liquidity:   liquidity,
  223.         Timestamp:   timestamp,
  224. -       maxHtlcMsat: maxHtlcMsat,
  225. -       minHtlcMsat: minHtlcMsat,
  226. +       maxHtlcMsat: channel.HtlcMaximumMilliSatoshis.MSat(),
  227. +       minHtlcMsat: channel.HtlcMinimumMilliSatoshis.MSat(),
  228.     }
  229.  }
  230.  
  231. @@ -43,17 +39,17 @@ func (c *Channel) ComputeFeePPM(amount uint64) uint64 {
  232.     return c.ComputeFee(amount) * 1000000 / amount
  233.  }
  234.  
  235. -func (c *Channel) GetHop(amount uint64, delay uint) glightning.RouteHop {
  236. +func (c *Channel) GetHop(amount uint64, delay uint32) glightning.RouteHop {
  237.     return glightning.RouteHop{
  238.         Id:             c.Destination,
  239.         ShortChannelId: c.ShortChannelId,
  240. -       MilliSatoshi:   amount,
  241. +       AmountMsat:     glightning.AmountFromMSat(amount),
  242.         Delay:          delay,
  243.         Direction:      c.GetDirection(),
  244.     }
  245.  }
  246.  
  247. -func (c *Channel) GetDirection() uint8 {
  248. +func (c *Channel) GetDirection() uint32 {
  249.     if c.Source < c.Destination {
  250.         return 0
  251.     }
  252. @@ -68,6 +64,6 @@ func (c *Channel) CanForward(amount uint64) bool {
  253.  }
  254.  
  255.  func (c *Channel) ResetLiquidity() {
  256. -   c.Liquidity = uint64(0.5 * float64(c.Satoshis*1000))
  257. +   c.Liquidity = uint64(0.5 * float64(c.AmountMsat.MSat()))
  258.     c.Timestamp = time.Now().Unix()
  259.  }
  260. diff --git a/graph/graph.go b/graph/graph.go
  261. index e110cbb..4bdb4e6 100644
  262. --- a/graph/graph.go
  263. +++ b/graph/graph.go
  264. @@ -3,8 +3,6 @@ package graph
  265.  import (
  266.     "circular/util"
  267.     "github.com/elementsproject/glightning/glightning"
  268. -   "strconv"
  269. -   "strings"
  270.     "sync"
  271.     "time"
  272.  )
  273. @@ -78,12 +76,10 @@ func (g *Graph) AddChannel(c *Channel) {
  274.     g.Inbound[c.Destination][c.Source] = append(g.Inbound[c.Destination][c.Source], c.ShortChannelId)
  275.  
  276.     if c.maxHtlcMsat == 0 {
  277. -       maxHtlcMsat, _ := strconv.ParseUint(strings.TrimSuffix(c.HtlcMaximumMilliSatoshis, "msat"), 10, 64)
  278. -       c.maxHtlcMsat = maxHtlcMsat
  279. +       c.maxHtlcMsat = c.HtlcMaximumMilliSatoshis.MSat()
  280.     }
  281.     if c.minHtlcMsat == 0 {
  282. -       minHtlcMsat, _ := strconv.ParseUint(strings.TrimSuffix(c.HtlcMinimumMilliSatoshis, "msat"), 10, 64)
  283. -       c.minHtlcMsat = minHtlcMsat
  284. +       c.minHtlcMsat = c.HtlcMinimumMilliSatoshis.MSat()
  285.     }
  286.  }
  287.  
  288. @@ -99,7 +95,7 @@ func (g *Graph) RefreshChannels(channelList []*glightning.Channel) {
  289.         channelId := c.ShortChannelId + "/" + util.GetDirection(c.Source, c.Destination)
  290.         // if the channel did not exist prior to this refresh estimate its initial liquidity to be 50/50
  291.         if _, ok := g.Channels[channelId]; !ok {
  292. -           channel = NewChannel(c, uint64(0.5*float64(c.Satoshis*1000)), 0)
  293. +           channel = NewChannel(c, uint64(0.5*float64(c.AmountMsat.MSat())), 0)
  294.             g.AddChannel(channel)
  295.         } else {
  296.             channel = NewChannel(c, g.Channels[channelId].Liquidity, g.Channels[channelId].Timestamp)
  297. @@ -175,7 +171,7 @@ func (g *Graph) UpdateChannel(channelId, oppositeChannelId string, amount uint64
  298.  
  299.     if _, ok := g.Channels[oppositeChannelId]; ok {
  300.         g.Channels[oppositeChannelId].Liquidity =
  301. -           g.Channels[oppositeChannelId].Satoshis*1000 - amount
  302. +           g.Channels[oppositeChannelId].AmountMsat.MSat() - amount
  303.         g.Channels[oppositeChannelId].Timestamp = now
  304.     }
  305.  }
  306. diff --git a/graph/route.go b/graph/route.go
  307. index dddde32..9224a39 100644
  308. --- a/graph/route.go
  309. +++ b/graph/route.go
  310. @@ -77,8 +77,8 @@ func (r *Route) ToLightningRoute() []glightning.RouteHop {
  311.         hops = append(hops, glightning.RouteHop{
  312.             Id:             hop.Destination,
  313.             ShortChannelId: hop.ShortChannelId,
  314. -           MilliSatoshi:   hop.MilliSatoshi,
  315. -           Delay:          hop.Delay,
  316. +           AmountMsat:     glightning.AmountFromMSat(hop.MilliSatoshi),
  317. +           Delay:          uint32(hop.Delay),
  318.             Direction:      hop.GetDirection(),
  319.         })
  320.     }
  321. diff --git a/graph/stats.go b/graph/stats.go
  322. index 902560c..cc1640b 100644
  323. --- a/graph/stats.go
  324. +++ b/graph/stats.go
  325. @@ -2,7 +2,6 @@ package graph
  326.  
  327.  import (
  328.     "strconv"
  329. -   "strings"
  330.  )
  331.  
  332.  type Stats struct {
  333. @@ -29,7 +28,7 @@ func (g *Graph) GetStats() *Stats {
  334.         if c.Liquidity >= 200000000 {
  335.             atLeast200kLiquidity++
  336.         }
  337. -       maxHtlc, _ := strconv.ParseUint(strings.TrimSuffix(c.HtlcMaximumMilliSatoshis, "msat"), 10, 64)
  338. +       maxHtlc := c.HtlcMaximumMilliSatoshis.MSat()
  339.         if maxHtlc >= 200000000 {
  340.             atLeast200kMaxHtlc++
  341.         }
  342. diff --git a/node/db.go b/node/db.go
  343. index 48504f3..0e9c442 100644
  344. --- a/node/db.go
  345. +++ b/node/db.go
  346. @@ -3,7 +3,7 @@ package node
  347.  import (
  348.     "circular/graph"
  349.     "encoding/json"
  350. -   badger "github.com/dgraph-io/badger/v3"
  351. +   "github.com/dgraph-io/badger/v4"
  352.     "github.com/elementsproject/glightning/glightning"
  353.     "log"
  354.     "time"
  355. diff --git a/node/payment.go b/node/payment.go
  356. index 61bd4de..086bb27 100644
  357. --- a/node/payment.go
  358. +++ b/node/payment.go
  359. @@ -4,7 +4,7 @@ import (
  360.     "circular/graph"
  361.     "circular/util"
  362.     "errors"
  363. -   "github.com/dgraph-io/badger/v3"
  364. +   "github.com/dgraph-io/badger/v4"
  365.     "github.com/elementsproject/glightning/glightning"
  366.     "time"
  367.  )
  368. diff --git a/node/peers.go b/node/peers.go
  369. index ac1e02e..6d03582 100644
  370. --- a/node/peers.go
  371. +++ b/node/peers.go
  372. @@ -104,13 +104,13 @@ func (n *Node) UpdateChannelBalance(outPeer, inPeer, outScid, inScid string, amo
  373.  
  374.     for _, channel := range n.Peers[outPeer].Channels {
  375.         if channel.ShortChannelId == outScid {
  376. -           channel.MilliSatoshiToUs -= amount * 1000
  377. +           channel.ToUsMsat = glightning.AmountFromMSat(channel.ToUsMsat.MSat() - amount*1000)
  378.             break
  379.         }
  380.     }
  381.     for _, channel := range n.Peers[inPeer].Channels {
  382.         if channel.ShortChannelId == inScid {
  383. -           channel.MilliSatoshiToUs += amount * 1000
  384. +           channel.ToUsMsat = glightning.AmountFromMSat(channel.ToUsMsat.MSat() + amount*1000)
  385.             break
  386.         }
  387.     }
  388. diff --git a/rebalance/bynode.go b/rebalance/bynode.go
  389. index 9c3a31c..8f5a0fa 100644
  390. --- a/rebalance/bynode.go
  391. +++ b/rebalance/bynode.go
  392. @@ -28,14 +28,14 @@ func (r *RebalanceByNode) New() interface{} {
  393.  
  394.  func (r *RebalanceByNode) getBestOutgoingChannel() (*graph.Channel, error) {
  395.     bestScid := r.Node.GetBestPeerChannel(r.OutNode, func(channel *glightning.PeerChannel) uint64 {
  396. -       return channel.MilliSatoshiToUs
  397. +       return channel.ToUsMsat.MSat()
  398.     }).ShortChannelId
  399.     return r.Node.GetOutgoingChannelFromScid(bestScid)
  400.  }
  401.  
  402.  func (r *RebalanceByNode) getBestIncomingChannel() (*graph.Channel, error) {
  403.     bestScid := r.Node.GetBestPeerChannel(r.InNode, func(channel *glightning.PeerChannel) uint64 {
  404. -       return channel.MilliSatoshiTotal - channel.MilliSatoshiToUs
  405. +       return channel.TotalMsat.MSat() - channel.ToUsMsat.MSat()
  406.     }).ShortChannelId
  407.     return r.Node.GetIncomingChannelFromScid(bestScid)
  408.  }
  409. diff --git a/rebalance/parallel/pull.go b/rebalance/parallel/pull.go
  410. index 2b0fc03..018ba90 100644
  411. --- a/rebalance/parallel/pull.go
  412. +++ b/rebalance/parallel/pull.go
  413. @@ -86,9 +86,9 @@ func (r *RebalancePull) IsGoodCandidate(peerChannel *glightning.PeerChannel) boo
  414.  // Check that the channel is not under the deplete threshold and connection is active
  415.  func (r *RebalancePull) CanUseChannel(channel *glightning.PeerChannel) error {
  416.     depleteAmount := util.Min(r.DepleteUpToAmount,
  417. -       uint64(float64(channel.MilliSatoshiTotal)*r.DepleteUpToPercent))
  418. +       uint64(float64(channel.TotalMsat.MSat())*r.DepleteUpToPercent))
  419.     r.Node.Logln(glightning.Debug, "depleteAmount:", depleteAmount)
  420. -   if channel.MilliSatoshiToUs < depleteAmount {
  421. +   if channel.ToUsMsat.MSat() < depleteAmount {
  422.         return util.ErrChannelDepleted
  423.     }
  424.  
  425. diff --git a/rebalance/parallel/push.go b/rebalance/parallel/push.go
  426. index d8dacf0..cb0cb08 100644
  427. --- a/rebalance/parallel/push.go
  428. +++ b/rebalance/parallel/push.go
  429. @@ -95,9 +95,9 @@ func (r *RebalancePush) IsGoodCandidate(peerChannel *glightning.PeerChannel) boo
  430.  func (r *RebalancePush) CanUseChannel(channel *glightning.PeerChannel) error {
  431.     // check that the channel is not over the fill threshold
  432.     fillAmount := util.Min(r.FillUpToAmount,
  433. -       uint64(float64(channel.MilliSatoshiTotal)*r.FillUpToPercent))
  434. +       uint64(float64(channel.TotalMsat.MSat())*r.FillUpToPercent))
  435.     r.Node.Logln(glightning.Debug, "fillAmount:", fillAmount)
  436. -   if (channel.MilliSatoshiTotal - channel.MilliSatoshiToUs) < fillAmount {
  437. +   if (channel.TotalMsat.MSat() - channel.ToUsMsat.MSat()) < fillAmount {
  438.         return util.ErrChannelFilled
  439.     }
  440.  
  441. diff --git a/rebalance/params.go b/rebalance/params.go
  442. index aa0f667..54413b8 100644
  443. --- a/rebalance/params.go
  444. +++ b/rebalance/params.go
  445. @@ -35,10 +35,10 @@ func (r *Rebalance) checkConnections(inChannel, outChannel *glightning.PeerChann
  446.  
  447.  func (r *Rebalance) checkLiquidity(inChannel, outChannel *glightning.PeerChannel) error {
  448.     //validate that the amount is less than the liquidity of the channels
  449. -   if (inChannel.MilliSatoshiTotal - inChannel.MilliSatoshiToUs) < r.Amount {
  450. +   if (inChannel.TotalMsat.MSat() - inChannel.ToUsMsat.MSat()) < r.Amount {
  451.         return util.ErrIncomingChannelDepleted
  452.     }
  453. -   if (outChannel.MilliSatoshiToUs) < r.Amount {
  454. +   if (outChannel.ToUsMsat.MSat()) < r.Amount {
  455.         return util.ErrOutgoingChannelDepleted
  456.     }
  457.     return nil
  458.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement